From 12aeef86ea9dfdbc5a3e24ee50d687bbde993089 Mon Sep 17 00:00:00 2001 From: Christoph Auer Date: Fri, 4 Sep 2015 16:13:49 +0200 Subject: [PATCH 01/17] Updated README.md Corrected style different typos --- README.md | 83 ++++++++++++++++++++++++++++++------------------------- 1 file changed, 46 insertions(+), 37 deletions(-) diff --git a/README.md b/README.md index 1b4b41452..298c5c274 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ -## [Telegram Desktop](https://tdesktop.com) – Official Telegram Messenger app +# [Telegram Desktop][telegram_desktop] – Official Telegram Messenger -This is complete source code and build instructions for alpha version of official desktop client for [Telegram](https://telegram.org) messenger, based on [Telegram API](https://core.telegram.org/) and [MTProto](https://core.telegram.org/mtproto) secure protocol. +This is complete source code and build instructions for alpha version of official desktop client for [Telegram][telegram] messenger, based on [Telegram API][telegram_api] and [MTProto][telegram_proto] secure protocol. -Source code is published under GPL v3, license is available [here](https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE). +Source code is published under GPL v3, license is available [here][license]. -###Supported systems +## Supported systems * Windows XP - Windows 10 (**not** RT) * Mac OS X 10.8 - Mac OS X 10.10 @@ -12,7 +12,7 @@ Source code is published under GPL v3, license is available [here](https://githu * Ubuntu 12.04 - Ubuntu 14.04 * Fedora 22 -###Third-party +## Third-party * Qt 5.3.2 and 5.5.0, slightly patched ([LGPL](http://qt-project.org/doc/qt-5/lgpl.html)) * OpenSSL 1.0.1g ([OpenSSL License](https://www.openssl.org/source/license.html)) @@ -25,44 +25,45 @@ Source code is published under GPL v3, license is available [here](https://githu * FFmpeg ([LGPL](https://www.ffmpeg.org/legal.html)) * Open Sans font ([Apache License](http://www.apache.org/licenses/LICENSE-2.0.html)) -###[Build instructions for Visual Studio 2013](https://github.com/telegramdesktop/tdesktop/blob/master/MSVC.md) +## Build instructions -###[Build instructions for XCode 6.4](https://github.com/telegramdesktop/tdesktop/blob/master/XCODE.md) +* [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] -###[Build instructions for XCode 6.4 for OS X 10.6 and 10.7](https://github.com/telegramdesktop/tdesktop/blob/master/XCODEold.md) +## Projects in Telegram solution -###[Build instructions for Qt Creator 3.2.0 Ubuntu](https://github.com/telegramdesktop/tdesktop/blob/master/QTCREATOR.md) +### Telegram -##Projects in Telegram solution +[Telegram Desktop][telegram_desktop] messenger -####Telegram +### Updater -tdesktop messenger +A little app, that is launched by Telegram when update is ready, replaces all files and launches it back. -####Updater +### Packer -little app, that is launched by Telegram when update is ready, replaces all files and launches it back +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. -####Packer +### Prepare -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 +Prepares a release for deployment, puts all current files to deploy/{version} folder. -####Prepare +**Windows**: +* tsetup{version}.exe installer +* Telegram.exe +* Telegram.pdb (debug info for crash minidumps view) +* tupdate{updversion} binary lzma update archive -prepares a release for deployment, puts all files to deploy/{version} folder, for Win: -* current tsetup{version}exe installer -* current Telegram.exe -* current Telegram.pdb (debug info for crash minidumps view) -* current tupdate{updversion} binary lzma update archive +**Mac**: +* tsetup{version}.dmg +* Telegram.app +* tmacupd{updversion} binary lzma update archive -for Mac: -* current tsetup{version}dmg -* current Telegram.app -* current tmacupd{updversion} binary lzma update archive +### MetaEmoji -####MetaEmoji - -creates four sprites and text2emoji replace code +Creates four sprites and text2emoji replace code * SourceFiles/art/emoji.png * SourceFiles/art/emoji_125x.png * SourceFiles/art/emoji_150x.png @@ -70,15 +71,15 @@ creates four sprites and text2emoji replace code * SourceFiles/art/emoji_250x.png * SourceFiles/gui/emoji_config.cpp -####MetaStyle +### MetaStyle -from two files and two sprites +From two files and two sprites * Resources/style_classes.txt * Resources/style.txt * SourceFiles/art/sprite.png * SourceFiles/art/sprite_200x.png -creates two other sprites, four sprite grids and style constants code +Creates two other sprites, four sprite grids and style constants code * SourceFiles/art/sprite_125x.png * SourceFiles/art/sprite_150x.png * SourceFiles/art/grid.png @@ -89,11 +90,19 @@ creates two other sprites, four sprite grids and style constants code * GeneratedFiles/style_auto.h * GeneratedFiles/style_auto.cpp -####MetaLang +### MetaLang -from langpack file -* Resources/lang.txt - -creates lang constants code and lang file parse code +Creates from languagepack file `Resources/lang.txt` language constants code and language file parse code: * GeneratedFiles/lang.h * GeneratedFiles/lang.cpp + +[//]: # (LINKS) +[telegram]: https://telegram.org +[telegram_desktop]: https://desktop.telegram.org +[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 \ No newline at end of file From 46f2154eab8366ea92b74a4b398451371624a884 Mon Sep 17 00:00:00 2001 From: Christoph Auer Date: Fri, 4 Sep 2015 16:15:57 +0200 Subject: [PATCH 02/17] Updated README.md Corrected style different typos (reverted from commit 12aeef86ea9dfdbc5a3e24ee50d687bbde993089) --- README.md | 83 +++++++++++++++++++++++++------------------------------ 1 file changed, 37 insertions(+), 46 deletions(-) diff --git a/README.md b/README.md index 298c5c274..1b4b41452 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ -# [Telegram Desktop][telegram_desktop] – Official Telegram Messenger +## [Telegram Desktop](https://tdesktop.com) – Official Telegram Messenger app -This is complete source code and build instructions for alpha version of official desktop client for [Telegram][telegram] messenger, based on [Telegram API][telegram_api] and [MTProto][telegram_proto] secure protocol. +This is complete source code and build instructions for alpha version of official desktop client for [Telegram](https://telegram.org) messenger, based on [Telegram API](https://core.telegram.org/) and [MTProto](https://core.telegram.org/mtproto) secure protocol. -Source code is published under GPL v3, license is available [here][license]. +Source code is published under GPL v3, license is available [here](https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE). -## Supported systems +###Supported systems * Windows XP - Windows 10 (**not** RT) * Mac OS X 10.8 - Mac OS X 10.10 @@ -12,7 +12,7 @@ Source code is published under GPL v3, license is available [here][license]. * Ubuntu 12.04 - Ubuntu 14.04 * Fedora 22 -## Third-party +###Third-party * Qt 5.3.2 and 5.5.0, slightly patched ([LGPL](http://qt-project.org/doc/qt-5/lgpl.html)) * OpenSSL 1.0.1g ([OpenSSL License](https://www.openssl.org/source/license.html)) @@ -25,45 +25,44 @@ Source code is published under GPL v3, license is available [here][license]. * FFmpeg ([LGPL](https://www.ffmpeg.org/legal.html)) * Open Sans font ([Apache License](http://www.apache.org/licenses/LICENSE-2.0.html)) -## Build instructions +###[Build instructions for Visual Studio 2013](https://github.com/telegramdesktop/tdesktop/blob/master/MSVC.md) -* [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] +###[Build instructions for XCode 6.4](https://github.com/telegramdesktop/tdesktop/blob/master/XCODE.md) -## Projects in Telegram solution +###[Build instructions for XCode 6.4 for OS X 10.6 and 10.7](https://github.com/telegramdesktop/tdesktop/blob/master/XCODEold.md) -### Telegram +###[Build instructions for Qt Creator 3.2.0 Ubuntu](https://github.com/telegramdesktop/tdesktop/blob/master/QTCREATOR.md) -[Telegram Desktop][telegram_desktop] messenger +##Projects in Telegram solution -### Updater +####Telegram -A little app, that is launched by Telegram when update is ready, replaces all files and launches it back. +tdesktop messenger -### Packer +####Updater -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. +little app, that is launched by Telegram when update is ready, replaces all files and launches it back -### Prepare +####Packer -Prepares a release for deployment, puts all current files to deploy/{version} folder. +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 -**Windows**: -* tsetup{version}.exe installer -* Telegram.exe -* Telegram.pdb (debug info for crash minidumps view) -* tupdate{updversion} binary lzma update archive +####Prepare -**Mac**: -* tsetup{version}.dmg -* Telegram.app -* tmacupd{updversion} binary lzma update archive +prepares a release for deployment, puts all files to deploy/{version} folder, for Win: +* current tsetup{version}exe installer +* current Telegram.exe +* current Telegram.pdb (debug info for crash minidumps view) +* current tupdate{updversion} binary lzma update archive -### MetaEmoji +for Mac: +* current tsetup{version}dmg +* current Telegram.app +* current tmacupd{updversion} binary lzma update archive -Creates four sprites and text2emoji replace code +####MetaEmoji + +creates four sprites and text2emoji replace code * SourceFiles/art/emoji.png * SourceFiles/art/emoji_125x.png * SourceFiles/art/emoji_150x.png @@ -71,15 +70,15 @@ Creates four sprites and text2emoji replace code * SourceFiles/art/emoji_250x.png * SourceFiles/gui/emoji_config.cpp -### MetaStyle +####MetaStyle -From two files and two sprites +from two files and two sprites * Resources/style_classes.txt * Resources/style.txt * SourceFiles/art/sprite.png * SourceFiles/art/sprite_200x.png -Creates two other sprites, four sprite grids and style constants code +creates two other sprites, four sprite grids and style constants code * SourceFiles/art/sprite_125x.png * SourceFiles/art/sprite_150x.png * SourceFiles/art/grid.png @@ -90,19 +89,11 @@ Creates two other sprites, four sprite grids and style constants code * GeneratedFiles/style_auto.h * GeneratedFiles/style_auto.cpp -### MetaLang +####MetaLang -Creates from languagepack file `Resources/lang.txt` language constants code and language file parse code: +from langpack file +* Resources/lang.txt + +creates lang constants code and lang file parse code * GeneratedFiles/lang.h * GeneratedFiles/lang.cpp - -[//]: # (LINKS) -[telegram]: https://telegram.org -[telegram_desktop]: https://desktop.telegram.org -[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 \ No newline at end of file From 56d110efc21a5c3c3d0680ede0889cd1fb6b7bc7 Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 7 Sep 2015 12:02:17 +0300 Subject: [PATCH 03/17] fixed notifications in OS X 10.8 --- Telegram/SourceFiles/pspecific_mac_p.mm | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Telegram/SourceFiles/pspecific_mac_p.mm b/Telegram/SourceFiles/pspecific_mac_p.mm index 845ca5e2a..3fbd37a5c 100644 --- a/Telegram/SourceFiles/pspecific_mac_p.mm +++ b/Telegram/SourceFiles/pspecific_mac_p.mm @@ -289,12 +289,16 @@ void PsMacWindowPrivate::showNotify(uint64 peer, int32 msgId, const QPixmap &pix [notification setTitle:QNSString(title).s()]; [notification setSubtitle:QNSString(subtitle).s()]; [notification setInformativeText:QNSString(msg).s()]; - [notification setContentImage:img]; + if ([notification respondsToSelector:@selector(setContentImage:)]) { + [notification setContentImage:img]; + } - if (withReply) [notification setHasReplyButton:YES]; + if (withReply && [notification respondsToSelector:@selector(setHasReplyButton:)]) { + [notification setHasReplyButton:YES]; + } [notification setSoundName:nil]; - + NSUserNotificationCenter *center = [NSUserNotificationCenter defaultUserNotificationCenter]; [center deliverNotification:notification]; From c45d9e9860a164e09884b7fb280f130502490125 Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 7 Sep 2015 18:53:46 +0300 Subject: [PATCH 04/17] fixed crash in showNextNotify, started reportspam button --- Telegram/SourceFiles/app.cpp | 15 +++++- Telegram/SourceFiles/dialogswidget.cpp | 3 +- Telegram/SourceFiles/historywidget.cpp | 73 ++++++++++++++++++++++++++ Telegram/SourceFiles/historywidget.h | 10 ++++ Telegram/SourceFiles/localstorage.cpp | 4 ++ Telegram/SourceFiles/localstorage.h | 2 + Telegram/SourceFiles/mainwidget.cpp | 4 ++ Telegram/SourceFiles/mainwidget.h | 2 + Telegram/SourceFiles/settings.cpp | 3 ++ Telegram/SourceFiles/settings.h | 4 ++ Telegram/SourceFiles/structs.h | 3 +- Telegram/SourceFiles/window.cpp | 8 +-- 12 files changed, 123 insertions(+), 8 deletions(-) diff --git a/Telegram/SourceFiles/app.cpp b/Telegram/SourceFiles/app.cpp index 3c0016f48..7d9385d53 100644 --- a/Telegram/SourceFiles/app.cpp +++ b/Telegram/SourceFiles/app.cpp @@ -566,10 +566,17 @@ namespace App { int32 pversion = chat->participants.isEmpty() ? 1 : (chat->participants.begin().value() + 1); chat->cankick = ChatData::CanKick(); for (QVector::const_iterator i = v.cbegin(), e = v.cend(); i != e; ++i) { - UserData *user = App::userLoaded(i->c_chatParticipant().vuser_id.v); + if (i->type() != mtpc_chatParticipant) continue; + + const MTPDchatParticipant &p(i->c_chatParticipant()); + //if (p.vuser_id.v == MTP::authedId()) { + // chat->inviter = p.vinviter_id.v; // we use inviter only from service msgs + // chat->inviteDate = p.vdate.v; + //} + UserData *user = App::userLoaded(p.vuser_id.v); if (user) { chat->participants[user] = pversion; - if (i->c_chatParticipant().vinviter_id.v == MTP::authedId()) { + if (p.vinviter_id.v == MTP::authedId()) { chat->cankick[user] = true; } } else { @@ -619,6 +626,10 @@ namespace App { ChatData *chat = App::chat(d.vchat_id.v); if (chat->version <= d.vversion.v && chat->count >= 0) { chat->version = d.vversion.v; + //if (d.vuser_id.v == MTP::authedId()) { + // chat->inviter = d.vinviter_id.v; // we use inviter only from service msgs + // chat->inviteDate = unixtime(); // no event date here :( + //} UserData *user = App::userLoaded(d.vuser_id.v); if (user) { if (chat->participants.isEmpty() && chat->count) { diff --git a/Telegram/SourceFiles/dialogswidget.cpp b/Telegram/SourceFiles/dialogswidget.cpp index 58ef6fc7e..8f1b50c39 100644 --- a/Telegram/SourceFiles/dialogswidget.cpp +++ b/Telegram/SourceFiles/dialogswidget.cpp @@ -814,7 +814,6 @@ void DialogsListWidget::peopleReceived(const QString &query, const QVector &contacts) { - cSetContactsReceived(true); for (QVector::const_iterator i = contacts.cbegin(), e = contacts.cend(); i != e; ++i) { int32 uid = i->c_contact().vuser_id.v; addNewContact(uid); @@ -1739,11 +1738,13 @@ void DialogsWidget::loadDialogs() { } void DialogsWidget::contactsReceived(const MTPcontacts_Contacts &contacts) { + cSetContactsReceived(true); if (contacts.type() == mtpc_contacts_contacts) { const MTPDcontacts_contacts &d(contacts.c_contacts_contacts()); App::feedUsers(d.vusers); list.contactsReceived(d.vcontacts.c_vector().v); } + if (App::main()) App::main()->contactsReceived(); } bool DialogsWidget::contactsFailed(const RPCError &error) { diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index 614eb4d68..64b8e57d7 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -2198,6 +2198,7 @@ HistoryWidget::HistoryWidget(QWidget *parent) : TWidget(parent) , _replyTo(0) , _replyToNameVersion(0) , _replyForwardPreviewCancel(this, st::replyCancel) +, _reportSpamStatus(ReportSpamUnknown) , _previewData(0) , _previewRequest(0) , _previewCancelled(false) @@ -2905,6 +2906,76 @@ void HistoryWidget::clearAllLoadRequests() { _preloadRequest = _preloadDownRequest = _firstLoadRequest = 0; } +void HistoryWidget::contactsReceived() { + if (!_peer) return; + updateReportSpamStatus(); + updateControlsVisibility(); +} + +void HistoryWidget::updateReportSpamStatus() { + if (!_peer || cNoReportSpamButton().contains(_peer->id)) { + _reportSpamStatus = ReportSpamNoButton; + return; + } else if (cShowReportSpamButton().contains(_peer->id)) { + _reportSpamStatus = ReportSpamShowButton; + return; + } + if (!cContactsReceived()) { + _reportSpamStatus = ReportSpamUnknown; + } else if (_peer->chat) { + if (_firstLoadRequest && !_peer->asChat()->inviterForSpamReport) { + _reportSpamStatus = ReportSpamUnknown; + } else if (_peer->asChat()->inviterForSpamReport > 0) { + UserData *user = App::userLoaded(_peer->asChat()->inviterForSpamReport); + if (user && user->contact > 0) { + _reportSpamStatus = ReportSpamNoButton; + } else { + _reportSpamStatus = ReportSpamShowButton; + } + } else { + _reportSpamStatus = ReportSpamNoButton; + } + } else { + if (_peer->asUser()->contact > 0) { + _reportSpamStatus = ReportSpamNoButton; + } else { + if (_firstLoadRequest) { + _reportSpamStatus = ReportSpamUnknown; + } else { + bool anyFound = false, outFound = false; + for (int32 i = 0, l = _history->size(); i < l; ++i) { + for (int32 j = 0, c = _history->at(i)->size(); j < c; ++j) { + anyFound = true; + if (_history->at(i)->at(j)->out()) { + outFound = true; + break; + } + } + } + if (anyFound) { + if (outFound) { + _reportSpamStatus = ReportSpamNoButton; + } else { + _reportSpamStatus = ReportSpamShowButton; + } + } else { + _reportSpamStatus = ReportSpamUnknown; + } + } + } + } + if (_reportSpamStatus == ReportSpamShowButton || _reportSpamStatus == ReportSpamNoButton) { + if (_reportSpamStatus == ReportSpamShowButton) { + cRefNoReportSpamButton().remove(_peer->id); + cRefShowReportSpamButton().insert(_peer->id, true); + } else { + cRefNoReportSpamButton().insert(_peer->id, true); + cRefShowReportSpamButton().remove(_peer->id); + } + Local::writeReportSpamStatuses(); + } +} + void HistoryWidget::updateControlsVisibility() { if (!_history || _showAnim.animating()) { _scroll.hide(); @@ -3519,6 +3590,7 @@ bool HistoryWidget::showStep(float64 ms) { } void HistoryWidget::doneShow() { + updateReportSpamStatus(); updateBotKeyboard(); updateControlsVisibility(); updateListSize(0, true); @@ -5167,6 +5239,7 @@ void HistoryWidget::onFullPeerUpdated(PeerData *data) { int32 newScrollTop = _scroll.scrollTop(); if (_list && data == _peer) { checkMentionDropdown(); + updateReportSpamStatus(); int32 lh = _list->height(), st = _scroll.scrollTop(); _list->updateBotInfo(); newScrollTop = st + _list->height() - lh; diff --git a/Telegram/SourceFiles/historywidget.h b/Telegram/SourceFiles/historywidget.h index 0ce5c0c81..2e4d9a994 100644 --- a/Telegram/SourceFiles/historywidget.h +++ b/Telegram/SourceFiles/historywidget.h @@ -478,6 +478,8 @@ public: void clearDelayedShowAt(); void clearAllLoadRequests(); + void contactsReceived(); + ~HistoryWidget(); signals: @@ -585,6 +587,14 @@ private: void drawRecording(Painter &p); void updateField(); + enum ReportSpamStatus { + ReportSpamNoButton, + ReportSpamUnknown, + ReportSpamShowButton, + }; + ReportSpamStatus _reportSpamStatus; + void updateReportSpamStatus(); + QString _previewLinks; WebPageData *_previewData; typedef QMap PreviewCache; diff --git a/Telegram/SourceFiles/localstorage.cpp b/Telegram/SourceFiles/localstorage.cpp index abb7952db..56fab4908 100644 --- a/Telegram/SourceFiles/localstorage.cpp +++ b/Telegram/SourceFiles/localstorage.cpp @@ -2944,6 +2944,10 @@ namespace Local { } } + void writeReportSpamStatuses() { + + } + struct ClearManagerData { QThread *thread; StorageMap images, stickers, audios; diff --git a/Telegram/SourceFiles/localstorage.h b/Telegram/SourceFiles/localstorage.h index 11b3f3871..5b20a3f7a 100644 --- a/Telegram/SourceFiles/localstorage.h +++ b/Telegram/SourceFiles/localstorage.h @@ -147,4 +147,6 @@ namespace Local { void removeSavedPeer(PeerData *peer); void readSavedPeers(); + void writeReportSpamStatuses(); + }; diff --git a/Telegram/SourceFiles/mainwidget.cpp b/Telegram/SourceFiles/mainwidget.cpp index 8e273cf68..71aee84fc 100644 --- a/Telegram/SourceFiles/mainwidget.cpp +++ b/Telegram/SourceFiles/mainwidget.cpp @@ -1967,6 +1967,10 @@ void MainWidget::clearBotStartToken(PeerData *peer) { } } +void MainWidget::contactsReceived() { + history.contactsReceived(); +} + void MainWidget::showPeerHistory(quint64 peerId, qint32 showAtMsgId, bool back) { if (!back && (!peerId || (_stack.size() == 1 && _stack[0]->type() == HistoryStackItem && _stack[0]->peer->id == peerId))) { back = true; diff --git a/Telegram/SourceFiles/mainwidget.h b/Telegram/SourceFiles/mainwidget.h index 8279caf12..f055081be 100644 --- a/Telegram/SourceFiles/mainwidget.h +++ b/Telegram/SourceFiles/mainwidget.h @@ -377,6 +377,8 @@ public: void choosePeer(PeerId peerId, MsgId showAtMsgId); // does offerPeer or showPeerHistory void clearBotStartToken(PeerData *peer); + void contactsReceived(); + ~MainWidget(); signals: diff --git a/Telegram/SourceFiles/settings.cpp b/Telegram/SourceFiles/settings.cpp index 78790d5f0..0e3a122b1 100644 --- a/Telegram/SourceFiles/settings.cpp +++ b/Telegram/SourceFiles/settings.cpp @@ -160,6 +160,9 @@ float64 gSongVolume = 0.9; SavedPeers gSavedPeers; SavedPeersByTime gSavedPeersByTime; +ReportSpamButtons gShowReportSpamButton; +ReportSpamButtons gNoReportSpamButton; + void settingsParseArgs(int argc, char *argv[]) { #ifdef Q_OS_MAC if (QSysInfo::macVersion() < QSysInfo::MV_10_8) { diff --git a/Telegram/SourceFiles/settings.h b/Telegram/SourceFiles/settings.h index ad36a2b1b..a138d0cb2 100644 --- a/Telegram/SourceFiles/settings.h +++ b/Telegram/SourceFiles/settings.h @@ -317,4 +317,8 @@ typedef QMultiMap SavedPeersByTime; DeclareRefSetting(SavedPeers, SavedPeers); DeclareRefSetting(SavedPeersByTime, SavedPeersByTime); +typedef QMap ReportSpamButtons; +DeclareRefSetting(ReportSpamButtons, ShowReportSpamButton); +DeclareRefSetting(ReportSpamButtons, NoReportSpamButton); + void settingsParseArgs(int argc, char *argv[]); diff --git a/Telegram/SourceFiles/structs.h b/Telegram/SourceFiles/structs.h index 32efe1053..5a509c960 100644 --- a/Telegram/SourceFiles/structs.h +++ b/Telegram/SourceFiles/structs.h @@ -208,13 +208,14 @@ struct UserData : public PeerData { }; struct ChatData : public PeerData { - ChatData(const PeerId &id) : PeerData(id), count(0), date(0), version(0), left(false), forbidden(true), botStatus(0) { + ChatData(const PeerId &id) : PeerData(id), count(0), date(0), version(0), inviterForSpamReport(0), left(false), forbidden(true), botStatus(0) { } void setPhoto(const MTPChatPhoto &photo, const PhotoId &phId = UnknownPeerPhotoId); int32 count; int32 date; int32 version; int32 admin; + int32 inviterForSpamReport; // > 0 - user who invited me to chat in unread service msg, < 0 - have outgoing message bool left; bool forbidden; typedef QMap Participants; diff --git a/Telegram/SourceFiles/window.cpp b/Telegram/SourceFiles/window.cpp index 8f18cfda6..13931cea0 100644 --- a/Telegram/SourceFiles/window.cpp +++ b/Telegram/SourceFiles/window.cpp @@ -1418,7 +1418,7 @@ void Window::notifyShowNext(NotifyWindow *remove) { HistoryItem *notifyItem = 0; History *notifyHistory = 0; NotifyWaiters::iterator notifyWaiter = notifyWaiters.end(); - for (NotifyWaiters::iterator i = notifyWaiters.begin(); i != notifyWaiters.end(); ++i) { + for (NotifyWaiters::iterator i = notifyWaiters.begin(); i != notifyWaiters.end();) { History *history = i.key(); if (history->currentNotification() && history->currentNotification()->id != i.value().msg) { NotifyWhenMaps::iterator j = notifyWhenMaps.find(history); @@ -1451,6 +1451,7 @@ void Window::notifyShowNext(NotifyWindow *remove) { notifyHistory = history; notifyWaiter = i; } + ++i; } if (notifyItem) { if (next > ms) { @@ -1467,8 +1468,7 @@ void Window::notifyShowNext(NotifyWindow *remove) { uint64 ms = getms(true); History *history = notifyItem->history(); NotifyWhenMaps::iterator j = notifyWhenMaps.find(history); - bool notifyWhenFound = (j != notifyWhenMaps.cend()); - if (!notifyWhenFound) { + if (j == notifyWhenMaps.cend()) { history->clearNotifications(); } else { HistoryItem *nextNotify = 0; @@ -1516,7 +1516,7 @@ void Window::notifyShowNext(NotifyWindow *remove) { if (!history->hasNotification()) { if (notifyWaiter != notifyWaiters.cend()) notifyWaiters.erase(notifyWaiter); - if (notifyWhenFound) notifyWhenMaps.erase(j); + notifyWhenMaps.remove(history); continue; } } From 28e09ab39e9d27cb38a0359936b82626e599e4ed Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 8 Sep 2015 15:20:30 +0300 Subject: [PATCH 05/17] report spam panel added --- Telegram/Resources/lang.strings | 3 + Telegram/Resources/style.txt | 29 +++++++++- Telegram/SourceFiles/history.cpp | 13 ++++- Telegram/SourceFiles/historywidget.cpp | 78 ++++++++++++++++++-------- Telegram/SourceFiles/historywidget.h | 24 ++++++++ Telegram/SourceFiles/mediaview.cpp | 6 +- 6 files changed, 126 insertions(+), 27 deletions(-) diff --git a/Telegram/Resources/lang.strings b/Telegram/Resources/lang.strings index 23fdd7453..0b3646c98 100644 --- a/Telegram/Resources/lang.strings +++ b/Telegram/Resources/lang.strings @@ -485,6 +485,9 @@ Copyright (c) 2014 John Preston, https://desktop.telegram.org "lng_in_dlg_sticker" = "Sticker"; "lng_in_dlg_sticker_emoji" = "{emoji} (sticker)"; +"lng_report_spam" = "Report Spam"; +"lng_report_spam_hide" = "Hide"; + "lng_send_button" = "Send"; "lng_message_ph" = "Write a message.."; "lng_record_cancel" = "Release outside this field to cancel"; diff --git a/Telegram/Resources/style.txt b/Telegram/Resources/style.txt index c258a78cf..3956587d8 100644 --- a/Telegram/Resources/style.txt +++ b/Telegram/Resources/style.txt @@ -1072,7 +1072,34 @@ textRectMargins: margins(-2px, -1px, -2px, -1px); taMsgField: flatTextarea(taDefFlat) { font: msgFont; } -maxFieldHeight: 243px; +maxFieldHeight: 220px; +// historyMinHeight: 56px; + +reportSpamButton: flatButton(topBarActionButton) { + textTop: 6px; + overTextTop: 6px; + downTextTop: 7px; + + width: -50px; + height: 30px; + + bgColor: #888; + overBgColor: #7b7b7b; + downBgColor: #7b7b7b; +} +reportSpamHide: flatButton(topBarButton) { + height: 46px; + + textTop: 15px; + overTextTop: 15px; + downTextTop: 16px; + + bgColor: transparent; + overBgColor: transparent; + downBgColor: transparent; +} +reportSpamPadding: size(12px, 8px); +reportSpamBg: #ffffffc0; newMsgSound: ':/gui/art/newmsg.wav'; diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index 512435906..e757adfc7 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -2220,8 +2220,11 @@ QString formatSizeText(qint64 size) { qint64 sizeTenthMb = (size * 10 / (1024 * 1024)); return QString::number(sizeTenthMb / 10) + '.' + QString::number(sizeTenthMb % 10) + qsl(" MB"); } - qint64 sizeTenthKb = (size * 10 / 1024); - return QString::number(sizeTenthKb / 10) + '.' + QString::number(sizeTenthKb % 10) + qsl(" KB"); + if (size >= 1024) { + qint64 sizeTenthKb = (size * 10 / 1024); + return QString::number(sizeTenthKb / 10) + '.' + QString::number(sizeTenthKb % 10) + qsl(" KB"); + } + return QString::number(size) + qsl(" B"); } QString formatDownloadText(qint64 ready, qint64 total) { @@ -2231,11 +2234,15 @@ QString formatDownloadText(qint64 ready, qint64 total) { readyStr = QString::number(readyTenthMb / 10) + '.' + QString::number(readyTenthMb % 10); totalStr = QString::number(totalTenthMb / 10) + '.' + QString::number(totalTenthMb % 10); mb = qsl("MB"); - } else { + } else if (total >= 1024) { qint64 readyKb = (ready / 1024), totalKb = (total / 1024); readyStr = QString::number(readyKb); totalStr = QString::number(totalKb); mb = qsl("KB"); + } else { + readyStr = QString::number(ready); + totalStr = QString::number(total); + mb = qsl("B"); } return lng_save_downloaded(lt_ready, readyStr, lt_total, totalStr, lt_mb, mb); } diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index 64b8e57d7..9b951163b 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -1636,6 +1636,29 @@ void MessageField::focusInEvent(QFocusEvent *e) { emit focused(); } +ReportSpamPanel::ReportSpamPanel(HistoryWidget *parent) : TWidget(parent), +_report(this, lang(lng_report_spam), st::reportSpamButton), _hide(this, lang(lng_report_spam_hide), st::reportSpamHide) { + resize(parent->width(), _hide.height() + st::titleShadow); + + connect(&_report, SIGNAL(clicked()), this, SIGNAL(reportClicked())); + connect(&_hide, SIGNAL(clicked()), this, SIGNAL(hideClicked())); +} + +void ReportSpamPanel::resizeEvent(QResizeEvent *e) { + _report.moveToLeft(st::reportSpamPadding.width(), st::reportSpamPadding.height(), width()); + _hide.moveToRight(0, 0, width()); +} + +void ReportSpamPanel::paintEvent(QPaintEvent *e) { + Painter p(this); + p.fillRect(QRect(0, 0, width(), height() - st::titleShadow), st::reportSpamBg->b); + if (cWideMode()) { + p.fillRect(st::titleShadow, height() - st::titleShadow, width() - st::titleShadow, st::titleShadow, st::titleShadowColor->b); + } else { + p.fillRect(0, height() - st::titleShadow, width(), st::titleShadow, st::titleShadowColor->b); + } +} + BotKeyboard::BotKeyboard() : _wasForMsgId(0), _height(0), _maxOuterHeight(0), _maximizeSize(false), _singleUse(false), _forceReply(false), _sel(-1), _down(-1), _hoverAnim(animFunc(this, &BotKeyboard::hoverStep)), _st(&st::botKbButton) { setGeometry(0, 0, _st->margin, _st->margin); @@ -2217,6 +2240,7 @@ HistoryWidget::HistoryWidget(QWidget *parent) : TWidget(parent) , _histInited(false) , _toHistoryEnd(this, st::historyToEnd) , _attachMention(this) +, _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) @@ -2329,6 +2353,9 @@ HistoryWidget::HistoryWidget(QWidget *parent) : TWidget(parent) _unblock.hide(); _botStart.hide(); + _reportSpamPanel.move(0, 0); + _reportSpamPanel.hide(); + _attachDocument.hide(); _attachPhoto.hide(); _attachEmoji.hide(); @@ -2920,12 +2947,10 @@ void HistoryWidget::updateReportSpamStatus() { _reportSpamStatus = ReportSpamShowButton; return; } - if (!cContactsReceived()) { + if ((!_history->loadedAtTop() && (_history->size() < 2 || _history->size() == 2 && _history->at(1)->size() < 2)) || !cContactsReceived() || _firstLoadRequest) { _reportSpamStatus = ReportSpamUnknown; } else if (_peer->chat) { - if (_firstLoadRequest && !_peer->asChat()->inviterForSpamReport) { - _reportSpamStatus = ReportSpamUnknown; - } else if (_peer->asChat()->inviterForSpamReport > 0) { + if (_peer->asChat()->inviterForSpamReport > 0) { UserData *user = App::userLoaded(_peer->asChat()->inviterForSpamReport); if (user && user->contact > 0) { _reportSpamStatus = ReportSpamNoButton; @@ -2939,28 +2964,24 @@ void HistoryWidget::updateReportSpamStatus() { if (_peer->asUser()->contact > 0) { _reportSpamStatus = ReportSpamNoButton; } else { - if (_firstLoadRequest) { - _reportSpamStatus = ReportSpamUnknown; - } else { - bool anyFound = false, outFound = false; - for (int32 i = 0, l = _history->size(); i < l; ++i) { - for (int32 j = 0, c = _history->at(i)->size(); j < c; ++j) { - anyFound = true; - if (_history->at(i)->at(j)->out()) { - outFound = true; - break; - } + bool anyFound = false, outFound = false; + for (int32 i = 0, l = _history->size(); i < l; ++i) { + for (int32 j = 0, c = _history->at(i)->size(); j < c; ++j) { + anyFound = true; + if (_history->at(i)->at(j)->out()) { + outFound = true; + break; } } - if (anyFound) { - if (outFound) { - _reportSpamStatus = ReportSpamNoButton; - } else { - _reportSpamStatus = ReportSpamShowButton; - } + } + if (anyFound) { + if (outFound) { + _reportSpamStatus = ReportSpamNoButton; } else { - _reportSpamStatus = ReportSpamUnknown; + _reportSpamStatus = ReportSpamShowButton; } + } else { + _reportSpamStatus = ReportSpamUnknown; } } } @@ -2978,6 +2999,7 @@ void HistoryWidget::updateReportSpamStatus() { void HistoryWidget::updateControlsVisibility() { if (!_history || _showAnim.animating()) { + _reportSpamPanel.hide(); _scroll.hide(); _kbScroll.hide(); _send.hide(); @@ -3004,6 +3026,11 @@ void HistoryWidget::updateControlsVisibility() { } else { _scroll.show(); } + if (_reportSpamStatus == ReportSpamShowButton) { + _reportSpamPanel.show(); + } else { + _reportSpamPanel.hide(); + } if ((_peer->chat && !_peer->asChat()->forbidden && !_peer->asChat()->left) || (!_peer->chat && _peer->asUser()->access != UserNoAccess)) { checkMentionDropdown(); if (isBlocked()) { @@ -3221,6 +3248,10 @@ void HistoryWidget::messagesReceived(const MTPmessages_Messages &messages, mtpRe addMessagesToFront(*histList); _preloadRequest = 0; onListScroll(); + if (_reportSpamStatus == ReportSpamUnknown) { + updateReportSpamStatus(); + if (_reportSpamStatus != ReportSpamUnknown) updateControlsVisibility(); + } } else if (_preloadDownRequest == requestId) { addMessagesToBack(*histList); _preloadDownRequest = 0; @@ -3542,6 +3573,7 @@ void HistoryWidget::animShow(const QPixmap &bgAnimCache, const QPixmap &bgAnimTo App::main()->topBar()->startAnim(); _scroll.hide(); _kbScroll.hide(); + _reportSpamPanel.hide(); _toHistoryEnd.hide(); _attachDocument.hide(); _attachPhoto.hide(); @@ -4588,6 +4620,8 @@ void HistoryWidget::msgUpdated(PeerId peer, const HistoryItem *msg) { } void HistoryWidget::resizeEvent(QResizeEvent *e) { + _reportSpamPanel.resize(width(), _reportSpamPanel.height()); + int32 maxKeyboardHeight = int(st::maxFieldHeight) - _field.height(); _keyboard.resizeToWidth(width(), maxKeyboardHeight); diff --git a/Telegram/SourceFiles/historywidget.h b/Telegram/SourceFiles/historywidget.h index 2e4d9a994..7e82a84e1 100644 --- a/Telegram/SourceFiles/historywidget.h +++ b/Telegram/SourceFiles/historywidget.h @@ -208,6 +208,28 @@ private: }; +class HistoryWidget; +class ReportSpamPanel : public TWidget { + Q_OBJECT + +public: + + ReportSpamPanel(HistoryWidget *parent); + + void resizeEvent(QResizeEvent *e); + void paintEvent(QPaintEvent *e); + +signals: + + void hideClicked(); + void reportClicked(); + +private: + + FlatButton _report, _hide; + +}; + class BotKeyboard : public QWidget { Q_OBJECT @@ -657,6 +679,8 @@ private: bool isBlocked() const; bool updateCmdStartShown(); + ReportSpamPanel _reportSpamPanel; + FlatButton _send, _unblock, _botStart; mtpRequestId _unblockRequest; IconedButton _attachDocument, _attachPhoto, _attachEmoji, _kbShow, _kbHide, _cmdStart; diff --git a/Telegram/SourceFiles/mediaview.cpp b/Telegram/SourceFiles/mediaview.cpp index 6baf5b562..b8a484ad1 100644 --- a/Telegram/SourceFiles/mediaview.cpp +++ b/Telegram/SourceFiles/mediaview.cpp @@ -206,11 +206,15 @@ void MediaView::updateDocSize() { readyStr = QString::number(readyTenthMb / 10) + '.' + QString::number(readyTenthMb % 10); totalStr = QString::number(totalTenthMb / 10) + '.' + QString::number(totalTenthMb % 10); mb = qsl("MB"); - } else { + } else if (total >= 1024) { qint64 readyKb = (ready / 1024), totalKb = (total / 1024); readyStr = QString::number(readyKb); totalStr = QString::number(totalKb); mb = qsl("KB"); + } else { + readyStr = QString::number(ready); + totalStr = QString::number(total); + mb = qsl("B"); } _docSize = lng_media_save_progress(lt_ready, readyStr, lt_total, totalStr, lt_mb, mb); } else { From 7a278729e1636fd4c6801d81c7dec8be4e80486c Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 8 Sep 2015 20:22:29 +0300 Subject: [PATCH 06/17] report spam almost done --- Telegram/Resources/lang.strings | 1 + Telegram/Resources/style.txt | 28 +- Telegram/SourceFiles/app.cpp | 8 + Telegram/SourceFiles/history.cpp | 10 + Telegram/SourceFiles/historywidget.cpp | 147 +- Telegram/SourceFiles/historywidget.h | 24 +- Telegram/SourceFiles/mainwidget.cpp | 7 +- Telegram/SourceFiles/mtproto/mtpCoreTypes.h | 2 +- Telegram/SourceFiles/mtproto/mtpScheme.cpp | 796 ++--- Telegram/SourceFiles/mtproto/mtpScheme.h | 3435 ++++++++++--------- Telegram/SourceFiles/mtproto/scheme.tl | 220 +- Telegram/SourceFiles/profilewidget.cpp | 3 +- Telegram/SourceFiles/settings.cpp | 3 +- Telegram/SourceFiles/settings.h | 5 +- Telegram/SourceFiles/types.h | 7 + 15 files changed, 2423 insertions(+), 2273 deletions(-) diff --git a/Telegram/Resources/lang.strings b/Telegram/Resources/lang.strings index 0b3646c98..4115544b4 100644 --- a/Telegram/Resources/lang.strings +++ b/Telegram/Resources/lang.strings @@ -487,6 +487,7 @@ Copyright (c) 2014 John Preston, https://desktop.telegram.org "lng_report_spam" = "Report Spam"; "lng_report_spam_hide" = "Hide"; +"lng_report_spam_thanks" = "Thank you for your report!"; "lng_send_button" = "Send"; "lng_message_ph" = "Write a message.."; diff --git a/Telegram/Resources/style.txt b/Telegram/Resources/style.txt index 3956587d8..697c39220 100644 --- a/Telegram/Resources/style.txt +++ b/Telegram/Resources/style.txt @@ -1075,18 +1075,6 @@ taMsgField: flatTextarea(taDefFlat) { maxFieldHeight: 220px; // historyMinHeight: 56px; -reportSpamButton: flatButton(topBarActionButton) { - textTop: 6px; - overTextTop: 6px; - downTextTop: 7px; - - width: -50px; - height: 30px; - - bgColor: #888; - overBgColor: #7b7b7b; - downBgColor: #7b7b7b; -} reportSpamHide: flatButton(topBarButton) { height: 46px; @@ -1098,8 +1086,20 @@ reportSpamHide: flatButton(topBarButton) { overBgColor: transparent; downBgColor: transparent; } -reportSpamPadding: size(12px, 8px); -reportSpamBg: #ffffffc0; +reportSpamButton: flatButton(reportSpamHide) { + textTop: 6px; + overTextTop: 6px; + downTextTop: 7px; + + width: -50px; + height: 30px; + + bgColor: #888; + overBgColor: #7b7b7b; + downBgColor: #7b7b7b; +} +reportSpamSeparator: 30px; +reportSpamBg: #fffffff0; newMsgSound: ':/gui/art/newmsg.wav'; diff --git a/Telegram/SourceFiles/app.cpp b/Telegram/SourceFiles/app.cpp index 7d9385d53..b598b067f 100644 --- a/Telegram/SourceFiles/app.cpp +++ b/Telegram/SourceFiles/app.cpp @@ -446,6 +446,10 @@ namespace App { data->setBotInfoVersion(-1); } data->contact = (flags & (MTPDuser_flag_contact | MTPDuser_flag_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 ((flags & MTPDuser_flag_self) && ::self != data) { ::self = data; if (App::wnd()) App::wnd()->updateGlobalMenu(); @@ -875,6 +879,10 @@ 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); + Local::writeReportSpamStatuses(); + } break; case mtpc_contactLinkHasPhone: user->contact = 0; diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index e757adfc7..e5c3ead6d 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -6320,6 +6320,11 @@ void HistoryServiceMsg::setMessageByAction(const MTPmessageAction &action) { UserData *u = App::user(App::peerFromUser(d.vuser_id)); second = TextLinkPtr(new PeerLink(u)); text = lng_action_add_user(lt_from, from, lt_user, textcmdLink(2, u->name)); + if (d.vuser_id.v == MTP::authedId() && unread()) { + if (history()->peer->chat && !history()->peer->asChat()->inviterForSpamReport && !_from->chat) { + history()->peer->asChat()->inviterForSpamReport = App::userFromPeer(_from->id); + } + } } } break; @@ -6337,6 +6342,11 @@ 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->chat && !history()->peer->asChat()->inviterForSpamReport && !_from->chat && App::userFromPeer(_from->id) != MTP::authedId()) { + history()->peer->asChat()->inviterForSpamReport = App::userFromPeer(_from->id); + } + } } break; case mtpc_messageActionChatDeletePhoto: { diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index 9b951163b..50cff2659 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -1637,16 +1637,23 @@ void MessageField::focusInEvent(QFocusEvent *e) { } ReportSpamPanel::ReportSpamPanel(HistoryWidget *parent) : TWidget(parent), -_report(this, lang(lng_report_spam), st::reportSpamButton), _hide(this, lang(lng_report_spam_hide), st::reportSpamHide) { +_report(this, lang(lng_report_spam), st::reportSpamHide), +_hide(this, lang(lng_report_spam_hide), st::reportSpamHide), +_clear(this, lang(lng_profile_delete_conversation)) { resize(parent->width(), _hide.height() + st::titleShadow); connect(&_report, SIGNAL(clicked()), this, SIGNAL(reportClicked())); connect(&_hide, SIGNAL(clicked()), this, SIGNAL(hideClicked())); + connect(&_clear, SIGNAL(clicked()), this, SIGNAL(clearClicked())); + + _clear.hide(); } void ReportSpamPanel::resizeEvent(QResizeEvent *e) { - _report.moveToLeft(st::reportSpamPadding.width(), st::reportSpamPadding.height(), width()); + _report.resize(width() - (_hide.width() + st::reportSpamSeparator) * 2, _report.height()); + _report.moveToLeft(_hide.width() + st::reportSpamSeparator, 0, width()); _hide.moveToRight(0, 0, width()); + _clear.move((width() - _clear.width()) / 2, height() - _clear.height() - ((height() - st::msgFont->height - _clear.height()) / 2)); } void ReportSpamPanel::paintEvent(QPaintEvent *e) { @@ -1657,6 +1664,22 @@ void ReportSpamPanel::paintEvent(QPaintEvent *e) { } else { p.fillRect(0, height() - st::titleShadow, width(), st::titleShadow, st::titleShadowColor->b); } + if (!_clear.isHidden()) { + p.setPen(st::black->p); + p.setFont(st::msgFont->f); + p.drawText(QRect(_report.x(), (_clear.y() - st::msgFont->height) / 2, _report.width(), st::msgFont->height), lang(lng_report_spam_thanks), style::al_top); + } +} + +void ReportSpamPanel::setReported(bool reported) { + if (reported) { + _report.hide(); + _clear.show(); + } else { + _report.show(); + _clear.hide(); + } + update(); } BotKeyboard::BotKeyboard() : _wasForMsgId(0), _height(0), _maxOuterHeight(0), _maximizeSize(false), _singleUse(false), _forceReply(false), @@ -2221,7 +2244,7 @@ HistoryWidget::HistoryWidget(QWidget *parent) : TWidget(parent) , _replyTo(0) , _replyToNameVersion(0) , _replyForwardPreviewCancel(this, st::replyCancel) -, _reportSpamStatus(ReportSpamUnknown) +, _reportSpamStatus(dbiprsUnknown) , _previewData(0) , _previewRequest(0) , _previewCancelled(false) @@ -2229,6 +2252,7 @@ HistoryWidget::HistoryWidget(QWidget *parent) : TWidget(parent) , _replyReturn(0) , _stickersUpdateRequest(0) , _peer(0) +, _clearPeer(0) , _showAtMsgId(0) , _preloadRequest(0), _preloadDownRequest(0) , _delayedShowAtMsgId(-1) @@ -2245,6 +2269,7 @@ HistoryWidget::HistoryWidget(QWidget *parent) : TWidget(parent) , _unblock(this, lang(lng_unblock_button), st::btnUnblock) , _botStart(this, lang(lng_bot_start), st::btnSend) , _unblockRequest(0) +, _reportSpamRequest(0) , _attachDocument(this, st::btnAttachDocument) , _attachPhoto(this, st::btnAttachPhoto) , _attachEmoji(this, st::btnAttachEmoji) @@ -2284,6 +2309,9 @@ HistoryWidget::HistoryWidget(QWidget *parent) : TWidget(parent) setAcceptDrops(true); connect(&_scroll, SIGNAL(scrolled()), this, SLOT(onListScroll())); + connect(&_reportSpamPanel, SIGNAL(reportClicked()), this, SLOT(onReportSpamClicked())); + connect(&_reportSpamPanel, SIGNAL(hideClicked()), this, SLOT(onReportSpamHide())); + connect(&_reportSpamPanel, SIGNAL(clearClicked()), this, SLOT(onReportSpamClear())); connect(&_toHistoryEnd, SIGNAL(clicked()), this, SLOT(onHistoryToEnd())); connect(&_replyForwardPreviewCancel, SIGNAL(clicked()), this, SLOT(onReplyForwardPreviewCancel())); connect(&_send, SIGNAL(clicked()), this, SLOT(onSend())); @@ -2823,7 +2851,7 @@ void HistoryWidget::showPeerHistory(const PeerId &peerId, MsgId showAtMsgId) { } _peer = peerId ? App::peer(peerId) : 0; - _unblockRequest = 0; + _unblockRequest = _reportSpamRequest = 0; _titlePeerText = QString(); _titlePeerTextWidth = 0; @@ -2940,29 +2968,33 @@ void HistoryWidget::contactsReceived() { } void HistoryWidget::updateReportSpamStatus() { - if (!_peer || cNoReportSpamButton().contains(_peer->id)) { - _reportSpamStatus = ReportSpamNoButton; - return; - } else if (cShowReportSpamButton().contains(_peer->id)) { - _reportSpamStatus = ReportSpamShowButton; + if (!_peer || App::userFromPeer(_peer->id) == MTP::authedId()) { + _reportSpamStatus = dbiprsNoButton; return; + } else { + ReportSpamStatuses::const_iterator i = cReportSpamStatuses().constFind(_peer->id); + if (i != cReportSpamStatuses().cend()) { + _reportSpamStatus = i.value(); + _reportSpamPanel.setReported(_reportSpamStatus == dbiprsReportSent); + return; + } } if ((!_history->loadedAtTop() && (_history->size() < 2 || _history->size() == 2 && _history->at(1)->size() < 2)) || !cContactsReceived() || _firstLoadRequest) { - _reportSpamStatus = ReportSpamUnknown; + _reportSpamStatus = dbiprsUnknown; } else if (_peer->chat) { if (_peer->asChat()->inviterForSpamReport > 0) { UserData *user = App::userLoaded(_peer->asChat()->inviterForSpamReport); if (user && user->contact > 0) { - _reportSpamStatus = ReportSpamNoButton; + _reportSpamStatus = dbiprsNoButton; } else { - _reportSpamStatus = ReportSpamShowButton; + _reportSpamStatus = dbiprsShowButton; } } else { - _reportSpamStatus = ReportSpamNoButton; + _reportSpamStatus = dbiprsNoButton; } } else { if (_peer->asUser()->contact > 0) { - _reportSpamStatus = ReportSpamNoButton; + _reportSpamStatus = dbiprsNoButton; } else { bool anyFound = false, outFound = false; for (int32 i = 0, l = _history->size(); i < l; ++i) { @@ -2976,23 +3008,18 @@ void HistoryWidget::updateReportSpamStatus() { } if (anyFound) { if (outFound) { - _reportSpamStatus = ReportSpamNoButton; + _reportSpamStatus = dbiprsNoButton; } else { - _reportSpamStatus = ReportSpamShowButton; + _reportSpamStatus = dbiprsShowButton; } } else { - _reportSpamStatus = ReportSpamUnknown; + _reportSpamStatus = dbiprsUnknown; } } } - if (_reportSpamStatus == ReportSpamShowButton || _reportSpamStatus == ReportSpamNoButton) { - if (_reportSpamStatus == ReportSpamShowButton) { - cRefNoReportSpamButton().remove(_peer->id); - cRefShowReportSpamButton().insert(_peer->id, true); - } else { - cRefNoReportSpamButton().insert(_peer->id, true); - cRefShowReportSpamButton().remove(_peer->id); - } + if (_reportSpamStatus == dbiprsShowButton || _reportSpamStatus == dbiprsNoButton) { + _reportSpamPanel.setReported(false); + cRefReportSpamStatuses().insert(_peer->id, _reportSpamStatus); Local::writeReportSpamStatuses(); } } @@ -3026,7 +3053,7 @@ void HistoryWidget::updateControlsVisibility() { } else { _scroll.show(); } - if (_reportSpamStatus == ReportSpamShowButton) { + if (_reportSpamStatus == dbiprsShowButton || _reportSpamStatus == dbiprsReportSent) { _reportSpamPanel.show(); } else { _reportSpamPanel.hide(); @@ -3248,9 +3275,9 @@ void HistoryWidget::messagesReceived(const MTPmessages_Messages &messages, mtpRe addMessagesToFront(*histList); _preloadRequest = 0; onListScroll(); - if (_reportSpamStatus == ReportSpamUnknown) { + if (_reportSpamStatus == dbiprsUnknown) { updateReportSpamStatus(); - if (_reportSpamStatus != ReportSpamUnknown) updateControlsVisibility(); + if (_reportSpamStatus != dbiprsUnknown) updateControlsVisibility(); } } else if (_preloadDownRequest == requestId) { addMessagesToBack(*histList); @@ -3483,10 +3510,18 @@ void HistoryWidget::unblockDone(PeerData *peer, const MTPBool &result) { bool HistoryWidget::unblockFail(const RPCError &error) { if (error.type().startsWith(qsl("FLOOD_WAIT_"))) return false; -// _unblockRequest = 0; + + _unblockRequest = 0; return false; } +void HistoryWidget::blockDone(PeerData *peer, const MTPBool &result) { + if (peer->chat) return; + + peer->asUser()->blocked = UserIsBlocked; + emit App::main()->peerUpdated(peer); +} + void HistoryWidget::onBotStart() { if (!_peer || _peer->chat || !_peer->asUser()->botInfo) { updateControlsVisibility(); @@ -4598,6 +4633,60 @@ void HistoryWidget::onAudioFailed(MsgId newId) { } } +void HistoryWidget::onReportSpamClicked() { + if (_reportSpamRequest) return; + + if (!_peer->chat) MTP::send(MTPcontacts_Block(_peer->asUser()->inputUser), rpcDone(&HistoryWidget::blockDone, _peer), RPCFailHandlerPtr(), 0, 5); + _reportSpamRequest = MTP::send(MTPmessages_ReportSpam(_peer->input), rpcDone(&HistoryWidget::reportSpamDone, _peer), rpcFail(&HistoryWidget::reportSpamFail)); +} + +void HistoryWidget::reportSpamDone(PeerData *peer, const MTPBool &result, mtpRequestId req) { + if (req == _reportSpamRequest) { + _reportSpamRequest = 0; + } + if (peer) { + cRefReportSpamStatuses().insert(peer->id, dbiprsReportSent); + Local::writeReportSpamStatuses(); + } + _reportSpamStatus = dbiprsReportSent; + _reportSpamPanel.setReported(_reportSpamStatus == dbiprsReportSent); +} + +bool HistoryWidget::reportSpamFail(const RPCError &error, mtpRequestId req) { + if (error.type().startsWith(qsl("FLOOD_WAIT_"))) return false; + + if (req == _reportSpamRequest) { + _reportSpamRequest = 0; + } + return false; +} + +void HistoryWidget::onReportSpamHide() { + if (_peer) { + cRefReportSpamStatuses().insert(_peer->id, dbiprsNoButton); + Local::writeReportSpamStatuses(); + } + _reportSpamStatus = dbiprsNoButton; + updateControlsVisibility(); +} + +void HistoryWidget::onReportSpamClear() { + ConfirmBox *box = new ConfirmBox(_peer->chat ? lng_sure_delete_and_exit(lt_group, _peer->name) : lng_sure_delete_history(lt_contact, _peer->name)); + connect(box, SIGNAL(confirmed()), this, SLOT(onReportSpamClearSure())); + App::wnd()->showLayer(box); + _clearPeer = _peer; +} + +void HistoryWidget::onReportSpamClearSure() { + if (_clearPeer->chat) { + App::wnd()->hideLayer(); + App::main()->showDialogs(); + MTP::send(MTPmessages_DeleteChatUser(MTP_int(_clearPeer->id & 0xFFFFFFFF), App::self()->inputUser), App::main()->rpcDone(&MainWidget::deleteHistoryAfterLeave, _clearPeer), App::main()->rpcFail(&MainWidget::leaveChatFailed, _clearPeer)); + } else { + App::main()->deleteConversation(_clearPeer); + } +} + void HistoryWidget::peerMessagesUpdated(PeerId peer) { if (_peer && _list && peer == _peer->id) { updateListSize(); diff --git a/Telegram/SourceFiles/historywidget.h b/Telegram/SourceFiles/historywidget.h index 7e82a84e1..4c11b46de 100644 --- a/Telegram/SourceFiles/historywidget.h +++ b/Telegram/SourceFiles/historywidget.h @@ -219,14 +219,18 @@ public: void resizeEvent(QResizeEvent *e); void paintEvent(QPaintEvent *e); + void setReported(bool reported); + signals: void hideClicked(); void reportClicked(); + void clearClicked(); private: FlatButton _report, _hide; + LinkButton _clear; }; @@ -539,6 +543,11 @@ public slots: void onDocumentFailed(MsgId msgId); void onAudioFailed(MsgId msgId); + void onReportSpamClicked(); + void onReportSpamHide(); + void onReportSpamClear(); + void onReportSpamClearSure(); + void onListScroll(); void onHistoryToEnd(); void onSend(bool ctrlShiftEnter = false, MsgId replyTo = -1); @@ -609,12 +618,7 @@ private: void drawRecording(Painter &p); void updateField(); - enum ReportSpamStatus { - ReportSpamNoButton, - ReportSpamUnknown, - ReportSpamShowButton, - }; - ReportSpamStatus _reportSpamStatus; + DBIPeerReportSpamStatus _reportSpamStatus; void updateReportSpamStatus(); QString _previewLinks; @@ -637,8 +641,12 @@ private: void addMessagesToFront(const QVector &messages); void addMessagesToBack(const QVector &messages); + void reportSpamDone(PeerData *peer, const MTPBool &result, mtpRequestId request); + bool reportSpamFail(const RPCError &error, mtpRequestId request); + void unblockDone(PeerData *peer, const MTPBool &result); bool unblockFail(const RPCError &error); + void blockDone(PeerData *peer, const MTPBool &result); void countHistoryShowFrom(); @@ -656,7 +664,7 @@ private: void updateDragAreas(); - PeerData *_peer; + PeerData *_peer, *_clearPeer; // cache _peer in _clearPeer when showing clear history box MsgId _showAtMsgId; mtpRequestId _firstLoadRequest, _preloadRequest, _preloadDownRequest; @@ -682,7 +690,7 @@ private: ReportSpamPanel _reportSpamPanel; FlatButton _send, _unblock, _botStart; - mtpRequestId _unblockRequest; + mtpRequestId _unblockRequest, _reportSpamRequest; IconedButton _attachDocument, _attachPhoto, _attachEmoji, _kbShow, _kbHide, _cmdStart; bool _cmdStartShown; MessageField _field; diff --git a/Telegram/SourceFiles/mainwidget.cpp b/Telegram/SourceFiles/mainwidget.cpp index 71aee84fc..98e083daf 100644 --- a/Telegram/SourceFiles/mainwidget.cpp +++ b/Telegram/SourceFiles/mainwidget.cpp @@ -760,7 +760,12 @@ void MainWidget::deleteHistoryPart(PeerData *peer, const MTPmessages_AffectedHis updPtsUpdated(d.vpts.v, d.vpts_count.v); int32 offset = d.voffset.v; - if (!MTP::authedId() || offset <= 0) return; + if (!MTP::authedId()) return; + if (offset <= 0) { + cRefReportSpamStatuses().remove(peer->id); + Local::writeReportSpamStatuses(); + return; + } MTP::send(MTPmessages_DeleteHistory(peer->input, d.voffset), rpcDone(&MainWidget::deleteHistoryPart, peer)); } diff --git a/Telegram/SourceFiles/mtproto/mtpCoreTypes.h b/Telegram/SourceFiles/mtproto/mtpCoreTypes.h index 682073f14..95e6340ac 100644 --- a/Telegram/SourceFiles/mtproto/mtpCoreTypes.h +++ b/Telegram/SourceFiles/mtproto/mtpCoreTypes.h @@ -366,7 +366,7 @@ static const mtpTypeId mtpLayers[] = { mtpc_invokeWithLayer17, mtpc_invokeWithLayer18, }, mtpLayerMaxSingle = sizeof(mtpLayers) / sizeof(mtpLayers[0]); -static const mtpPrime mtpCurrentLayer = 36; +static const mtpPrime mtpCurrentLayer = 37; template class MTPBoxed : public bareT { diff --git a/Telegram/SourceFiles/mtproto/mtpScheme.cpp b/Telegram/SourceFiles/mtproto/mtpScheme.cpp index d6bd9b55d..79d35b846 100644 --- a/Telegram/SourceFiles/mtproto/mtpScheme.cpp +++ b/Telegram/SourceFiles/mtproto/mtpScheme.cpp @@ -1256,7 +1256,9 @@ void mtpTextSerializeType(MTPStringLogger &to, const mtpPrime *&from, const mtpP 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(" 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; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } break; @@ -2451,7 +2453,8 @@ void mtpTextSerializeType(MTPStringLogger &to, const mtpPrime *&from, const mtpP 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(" 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(" 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; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } break; @@ -4496,6 +4499,20 @@ void mtpTextSerializeType(MTPStringLogger &to, const mtpPrime *&from, const mtpP } break; + case mtpc_auth_sendSms: + if (stage) { + to.add(",\n").addSpaces(lev); + } else { + to.add("{ auth_sendSms"); + 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; + } + break; + case mtpc_account_registerDevice: if (stage) { to.add(",\n").addSpaces(lev); @@ -4560,158 +4577,6 @@ void mtpTextSerializeType(MTPStringLogger &to, const mtpPrime *&from, const mtpP } break; - case mtpc_contacts_deleteContacts: - if (stage) { - to.add(",\n").addSpaces(lev); - } else { - to.add("{ contacts_deleteContacts"); - to.add("\n").addSpaces(lev); - } - switch (stage) { - case 0: to.add(" id: "); ++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; - } - break; - - case mtpc_contacts_block: - if (stage) { - to.add(",\n").addSpaces(lev); - } else { - to.add("{ contacts_block"); - 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; - } - break; - - case mtpc_contacts_unblock: - if (stage) { - to.add(",\n").addSpaces(lev); - } else { - to.add("{ contacts_unblock"); - 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; - } - break; - - case mtpc_messages_setTyping: - if (stage) { - to.add(",\n").addSpaces(lev); - } else { - to.add("{ messages_setTyping"); - to.add("\n").addSpaces(lev); - } - switch (stage) { - case 0: to.add(" peer: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" 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; - } - break; - - case mtpc_upload_saveFilePart: - if (stage) { - to.add(",\n").addSpaces(lev); - } else { - to.add("{ upload_saveFilePart"); - 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; - default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; - } - break; - - case mtpc_help_saveAppLog: - if (stage) { - to.add(",\n").addSpaces(lev); - } else { - to.add("{ help_saveAppLog"); - to.add("\n").addSpaces(lev); - } - switch (stage) { - case 0: to.add(" events: "); ++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; - } - break; - - case mtpc_messages_discardEncryption: - if (stage) { - to.add(",\n").addSpaces(lev); - } else { - to.add("{ messages_discardEncryption"); - 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; - default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; - } - break; - - case mtpc_messages_setEncryptedTyping: - if (stage) { - to.add(",\n").addSpaces(lev); - } else { - to.add("{ messages_setEncryptedTyping"); - to.add("\n").addSpaces(lev); - } - switch (stage) { - case 0: to.add(" peer: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" typing: "); ++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; - } - break; - - case mtpc_messages_readEncryptedHistory: - if (stage) { - to.add(",\n").addSpaces(lev); - } else { - to.add("{ messages_readEncryptedHistory"); - to.add("\n").addSpaces(lev); - } - switch (stage) { - case 0: to.add(" peer: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" max_date: "); ++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; - } - break; - - case mtpc_upload_saveBigFilePart: - if (stage) { - to.add(",\n").addSpaces(lev); - } else { - to.add("{ upload_saveBigFilePart"); - 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; - default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; - } - break; - - case mtpc_auth_sendSms: - if (stage) { - to.add(",\n").addSpaces(lev); - } else { - to.add("{ auth_sendSms"); - 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; - } - break; - case mtpc_account_checkUsername: if (stage) { to.add(",\n").addSpaces(lev); @@ -4791,6 +4656,100 @@ void mtpTextSerializeType(MTPStringLogger &to, const mtpPrime *&from, const mtpP } break; + case mtpc_contacts_deleteContacts: + if (stage) { + to.add(",\n").addSpaces(lev); + } else { + to.add("{ contacts_deleteContacts"); + to.add("\n").addSpaces(lev); + } + switch (stage) { + case 0: to.add(" id: "); ++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; + } + break; + + case mtpc_contacts_block: + if (stage) { + to.add(",\n").addSpaces(lev); + } else { + to.add("{ contacts_block"); + 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; + } + break; + + case mtpc_contacts_unblock: + if (stage) { + to.add(",\n").addSpaces(lev); + } else { + to.add("{ contacts_unblock"); + 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; + } + break; + + case mtpc_messages_setTyping: + if (stage) { + to.add(",\n").addSpaces(lev); + } else { + to.add("{ messages_setTyping"); + to.add("\n").addSpaces(lev); + } + switch (stage) { + case 0: to.add(" peer: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" 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; + } + break; + + case mtpc_messages_discardEncryption: + if (stage) { + to.add(",\n").addSpaces(lev); + } else { + to.add("{ messages_discardEncryption"); + 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; + default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; + } + break; + + case mtpc_messages_setEncryptedTyping: + if (stage) { + to.add(",\n").addSpaces(lev); + } else { + to.add("{ messages_setEncryptedTyping"); + to.add("\n").addSpaces(lev); + } + switch (stage) { + case 0: to.add(" peer: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" typing: "); ++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; + } + break; + + case mtpc_messages_readEncryptedHistory: + if (stage) { + to.add(",\n").addSpaces(lev); + } else { + to.add("{ messages_readEncryptedHistory"); + to.add("\n").addSpaces(lev); + } + switch (stage) { + case 0: to.add(" peer: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" max_date: "); ++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; + } + break; + case mtpc_messages_installStickerSet: if (stage) { to.add(",\n").addSpaces(lev); @@ -4818,6 +4777,63 @@ void mtpTextSerializeType(MTPStringLogger &to, const mtpPrime *&from, const mtpP } break; + case mtpc_messages_reportSpam: + if (stage) { + to.add(",\n").addSpaces(lev); + } else { + to.add("{ messages_reportSpam"); + 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; + } + break; + + case mtpc_upload_saveFilePart: + if (stage) { + to.add(",\n").addSpaces(lev); + } else { + to.add("{ upload_saveFilePart"); + 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; + default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; + } + break; + + case mtpc_upload_saveBigFilePart: + if (stage) { + to.add(",\n").addSpaces(lev); + } else { + to.add("{ upload_saveBigFilePart"); + 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; + default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; + } + break; + + case mtpc_help_saveAppLog: + if (stage) { + to.add(",\n").addSpaces(lev); + } else { + to.add("{ help_saveAppLog"); + to.add("\n").addSpaces(lev); + } + switch (stage) { + case 0: to.add(" events: "); ++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; + } + break; + case mtpc_invokeAfterMsg: if (stage) { to.add(",\n").addSpaces(lev); @@ -5022,6 +5038,10 @@ void mtpTextSerializeType(MTPStringLogger &to, const mtpPrime *&from, const mtpP } break; + case mtpc_auth_requestPasswordRecovery: + to.add("{ auth_requestPasswordRecovery }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); + break; + case mtpc_account_getNotifySettings: if (stage) { to.add(",\n").addSpaces(lev); @@ -5049,19 +5069,6 @@ void mtpTextSerializeType(MTPStringLogger &to, const mtpPrime *&from, const mtpP } break; - case mtpc_contacts_importCard: - if (stage) { - to.add(",\n").addSpaces(lev); - } else { - to.add("{ contacts_importCard"); - 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; - default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; - } - break; - case mtpc_account_updateUsername: if (stage) { to.add(",\n").addSpaces(lev); @@ -5075,19 +5082,6 @@ void mtpTextSerializeType(MTPStringLogger &to, const mtpPrime *&from, const mtpP } break; - case mtpc_contacts_resolveUsername: - if (stage) { - to.add(",\n").addSpaces(lev); - } else { - to.add("{ contacts_resolveUsername"); - 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; - default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; - } - break; - case mtpc_account_changePhone: if (stage) { to.add(",\n").addSpaces(lev); @@ -5103,10 +5097,101 @@ void mtpTextSerializeType(MTPStringLogger &to, const mtpPrime *&from, const mtpP } break; + case mtpc_contacts_importCard: + if (stage) { + to.add(",\n").addSpaces(lev); + } else { + to.add("{ contacts_importCard"); + 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; + default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; + } + break; + + case mtpc_contacts_resolveUsername: + if (stage) { + to.add(",\n").addSpaces(lev); + } else { + to.add("{ contacts_resolveUsername"); + 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; + default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; + } + break; + case mtpc_account_getWallPapers: to.add("{ account_getWallPapers }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; + case mtpc_account_getPrivacy: + if (stage) { + to.add(",\n").addSpaces(lev); + } else { + to.add("{ account_getPrivacy"); + to.add("\n").addSpaces(lev); + } + switch (stage) { + case 0: to.add(" key: "); ++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; + } + break; + + case mtpc_account_setPrivacy: + if (stage) { + to.add(",\n").addSpaces(lev); + } else { + to.add("{ account_setPrivacy"); + to.add("\n").addSpaces(lev); + } + switch (stage) { + case 0: to.add(" key: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" rules: "); ++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; + } + break; + + case mtpc_account_getAccountTTL: + to.add("{ account_getAccountTTL }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); + break; + + case mtpc_account_sendChangePhoneCode: + 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; + } + break; + + case mtpc_account_getAuthorizations: + to.add("{ account_getAuthorizations }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); + break; + + case mtpc_account_getPassword: + to.add("{ account_getPassword }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); + break; + + case mtpc_account_getPasswordSettings: + if (stage) { + to.add(",\n").addSpaces(lev); + } else { + to.add("{ account_getPasswordSettings"); + 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; + default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; + } + break; + case mtpc_users_getUsers: if (stage) { to.add(",\n").addSpaces(lev); @@ -5208,6 +5293,20 @@ void mtpTextSerializeType(MTPStringLogger &to, const mtpPrime *&from, const mtpP to.add("{ contacts_exportCard }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; + case mtpc_contacts_search: + if (stage) { + to.add(",\n").addSpaces(lev); + } else { + to.add("{ contacts_search"); + 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; + default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; + } + break; + case mtpc_messages_getMessages: if (stage) { to.add(",\n").addSpaces(lev); @@ -5549,149 +5648,6 @@ void mtpTextSerializeType(MTPStringLogger &to, const mtpPrime *&from, const mtpP } break; - case mtpc_updates_getState: - to.add("{ updates_getState }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); - break; - - case mtpc_updates_getDifference: - if (stage) { - to.add(",\n").addSpaces(lev); - } else { - to.add("{ updates_getDifference"); - 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; - default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; - } - break; - - case mtpc_photos_updateProfilePhoto: - if (stage) { - to.add(",\n").addSpaces(lev); - } else { - to.add("{ photos_updateProfilePhoto"); - 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(" 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; - } - break; - - case mtpc_photos_uploadProfilePhoto: - if (stage) { - to.add(",\n").addSpaces(lev); - } else { - to.add("{ photos_uploadProfilePhoto"); - 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(" caption: "); ++stages.back(); types.push_back(mtpc_string); 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; - } - break; - - case mtpc_photos_deletePhotos: - if (stage) { - to.add(",\n").addSpaces(lev); - } else { - to.add("{ photos_deletePhotos"); - to.add("\n").addSpaces(lev); - } - switch (stage) { - case 0: to.add(" id: "); ++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; - } - break; - - case mtpc_messages_receivedQueue: - if (stage) { - to.add(",\n").addSpaces(lev); - } else { - to.add("{ messages_receivedQueue"); - 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; - default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; - } - break; - - case mtpc_upload_getFile: - if (stage) { - to.add(",\n").addSpaces(lev); - } else { - to.add("{ upload_getFile"); - to.add("\n").addSpaces(lev); - } - 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; - default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; - } - break; - - case mtpc_help_getConfig: - to.add("{ help_getConfig }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); - break; - - case mtpc_help_getNearestDc: - to.add("{ help_getNearestDc }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); - break; - - case mtpc_help_getAppUpdate: - if (stage) { - to.add(",\n").addSpaces(lev); - } else { - to.add("{ help_getAppUpdate"); - 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; - default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; - } - break; - - case mtpc_help_getInviteText: - if (stage) { - to.add(",\n").addSpaces(lev); - } else { - to.add("{ help_getInviteText"); - 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; - default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; - } - break; - - case mtpc_photos_getUserPhotos: - if (stage) { - to.add(",\n").addSpaces(lev); - } else { - to.add("{ photos_getUserPhotos"); - to.add("\n").addSpaces(lev); - } - switch (stage) { - case 0: to.add(" user_id: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" 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; - default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; - } - break; - case mtpc_messages_getDhConfig: if (stage) { to.add(",\n").addSpaces(lev); @@ -5782,64 +5738,28 @@ void mtpTextSerializeType(MTPStringLogger &to, const mtpPrime *&from, const mtpP } break; - case mtpc_help_getSupport: - to.add("{ help_getSupport }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); - break; - - case mtpc_contacts_search: + case mtpc_messages_receivedQueue: if (stage) { to.add(",\n").addSpaces(lev); } else { - to.add("{ contacts_search"); + to.add("{ messages_receivedQueue"); 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(" max_qts: "); ++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; } break; - case mtpc_account_getPrivacy: + case mtpc_photos_deletePhotos: if (stage) { to.add(",\n").addSpaces(lev); } else { - to.add("{ account_getPrivacy"); + to.add("{ photos_deletePhotos"); to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" key: "); ++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; - } - break; - - case mtpc_account_setPrivacy: - if (stage) { - to.add(",\n").addSpaces(lev); - } else { - to.add("{ account_setPrivacy"); - to.add("\n").addSpaces(lev); - } - switch (stage) { - case 0: to.add(" key: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" rules: "); ++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; - } - break; - - case mtpc_account_getAccountTTL: - to.add("{ account_getAccountTTL }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); - break; - - case mtpc_account_sendChangePhoneCode: - 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; + case 0: to.add(" id: "); ++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; } break; @@ -5884,31 +5804,6 @@ void mtpTextSerializeType(MTPStringLogger &to, const mtpPrime *&from, const mtpP } break; - case mtpc_account_getAuthorizations: - to.add("{ account_getAuthorizations }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); - break; - - case mtpc_account_getPassword: - to.add("{ account_getPassword }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); - break; - - case mtpc_account_getPasswordSettings: - if (stage) { - to.add(",\n").addSpaces(lev); - } else { - to.add("{ account_getPasswordSettings"); - 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; - default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; - } - break; - - case mtpc_auth_requestPasswordRecovery: - to.add("{ auth_requestPasswordRecovery }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); - break; - case mtpc_messages_exportChatInvite: if (stage) { to.add(",\n").addSpaces(lev); @@ -5948,6 +5843,127 @@ void mtpTextSerializeType(MTPStringLogger &to, const mtpPrime *&from, const mtpP } break; + case mtpc_updates_getState: + to.add("{ updates_getState }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); + break; + + case mtpc_updates_getDifference: + if (stage) { + to.add(",\n").addSpaces(lev); + } else { + to.add("{ updates_getDifference"); + 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; + default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; + } + break; + + case mtpc_photos_updateProfilePhoto: + if (stage) { + to.add(",\n").addSpaces(lev); + } else { + to.add("{ photos_updateProfilePhoto"); + 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(" 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; + } + break; + + case mtpc_photos_uploadProfilePhoto: + if (stage) { + to.add(",\n").addSpaces(lev); + } else { + to.add("{ photos_uploadProfilePhoto"); + 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(" caption: "); ++stages.back(); types.push_back(mtpc_string); 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; + } + break; + + case mtpc_photos_getUserPhotos: + if (stage) { + to.add(",\n").addSpaces(lev); + } else { + to.add("{ photos_getUserPhotos"); + to.add("\n").addSpaces(lev); + } + switch (stage) { + case 0: to.add(" user_id: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" 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; + default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; + } + break; + + case mtpc_upload_getFile: + if (stage) { + to.add(",\n").addSpaces(lev); + } else { + to.add("{ upload_getFile"); + to.add("\n").addSpaces(lev); + } + 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; + default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; + } + break; + + case mtpc_help_getConfig: + to.add("{ help_getConfig }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); + break; + + case mtpc_help_getNearestDc: + to.add("{ help_getNearestDc }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); + break; + + case mtpc_help_getAppUpdate: + if (stage) { + to.add(",\n").addSpaces(lev); + } else { + to.add("{ help_getAppUpdate"); + 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; + default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; + } + break; + + case mtpc_help_getInviteText: + if (stage) { + to.add(",\n").addSpaces(lev); + } else { + to.add("{ help_getInviteText"); + 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; + default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; + } + break; + + case mtpc_help_getSupport: + to.add("{ help_getSupport }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); + break; + case mtpc_help_getAppChangelog: if (stage) { to.add(",\n").addSpaces(lev); diff --git a/Telegram/SourceFiles/mtproto/mtpScheme.h b/Telegram/SourceFiles/mtproto/mtpScheme.h index 82b548bb1..9fc3f6af5 100644 --- a/Telegram/SourceFiles/mtproto/mtpScheme.h +++ b/Telegram/SourceFiles/mtproto/mtpScheme.h @@ -68,10 +68,13 @@ enum { mtpc_inputPeerEmpty = 0x7f3b18ea, mtpc_inputPeerSelf = 0x7da07ec9, mtpc_inputPeerChat = 0x179be863, + mtpc_inputPeerUser = 0x7b8e7de6, mtpc_inputUserEmpty = 0xb98886cf, mtpc_inputUserSelf = 0xf7c1b13f, + mtpc_inputUser = 0xd8292816, mtpc_inputPhoneContact = 0xf392b7f4, mtpc_inputFile = 0xf52ff27f, + mtpc_inputFileBig = 0xfa4f0bb5, mtpc_inputMediaEmpty = 0x9664f57f, mtpc_inputMediaUploadedPhoto = 0xf7aff1c0, mtpc_inputMediaPhoto = 0xe9bfb4f3, @@ -80,6 +83,12 @@ enum { mtpc_inputMediaUploadedVideo = 0x82713fdf, mtpc_inputMediaUploadedThumbVideo = 0x7780ddf9, mtpc_inputMediaVideo = 0x936a4ebd, + mtpc_inputMediaUploadedAudio = 0x4e498cab, + mtpc_inputMediaAudio = 0x89938781, + mtpc_inputMediaUploadedDocument = 0xffe76b78, + mtpc_inputMediaUploadedThumbDocument = 0x41481486, + mtpc_inputMediaDocument = 0xd184e841, + mtpc_inputMediaVenue = 0x2827a81a, mtpc_inputChatPhotoEmpty = 0x1ca48f57, mtpc_inputChatUploadedPhoto = 0x94254732, mtpc_inputChatPhoto = 0xb2e1bf08, @@ -91,6 +100,9 @@ enum { mtpc_inputVideo = 0xee579652, mtpc_inputFileLocation = 0x14637196, mtpc_inputVideoFileLocation = 0x3d0364ec, + mtpc_inputEncryptedFileLocation = 0xf5235d55, + mtpc_inputAudioFileLocation = 0x74dc404d, + mtpc_inputDocumentFileLocation = 0x4e45abe9, mtpc_inputPhotoCropAuto = 0xade6b004, mtpc_inputPhotoCrop = 0xd9915325, mtpc_inputAppEvent = 0x770656a8, @@ -109,17 +121,21 @@ enum { mtpc_fileLocationUnavailable = 0x7c596b46, mtpc_fileLocation = 0x53d69076, mtpc_userEmpty = 0x200250ba, + mtpc_user = 0x22e49072, mtpc_userProfilePhotoEmpty = 0x4f11bae1, mtpc_userProfilePhoto = 0xd559d8c8, mtpc_userStatusEmpty = 0x9d05049, mtpc_userStatusOnline = 0xedb93949, mtpc_userStatusOffline = 0x8c703f, + mtpc_userStatusRecently = 0xe26f42f1, + mtpc_userStatusLastWeek = 0x7bf09fc, + mtpc_userStatusLastMonth = 0x77ebc742, mtpc_chatEmpty = 0x9ba2d800, mtpc_chat = 0x6e9c9bc7, mtpc_chatForbidden = 0xfb0ccc41, mtpc_chatFull = 0x2e02a614, mtpc_chatParticipant = 0xc8d7493e, - mtpc_chatParticipantsForbidden = 0xfd2bb8a, + mtpc_chatParticipantsForbidden = 0xfc900c2b, mtpc_chatParticipants = 0x7841b415, mtpc_chatPhotoEmpty = 0x37c1011c, mtpc_chatPhoto = 0x6153276a, @@ -132,6 +148,10 @@ enum { mtpc_messageMediaGeo = 0x56e0d474, mtpc_messageMediaContact = 0x5e7d2f39, mtpc_messageMediaUnsupported = 0x9f84f49e, + mtpc_messageMediaDocument = 0x2fda2204, + mtpc_messageMediaAudio = 0xc6b68300, + mtpc_messageMediaWebPage = 0xa32dd600, + mtpc_messageMediaVenue = 0x7912b71f, mtpc_messageActionEmpty = 0xb6aef7b0, mtpc_messageActionChatCreate = 0xa6638b9a, mtpc_messageActionChatEditTitle = 0xb5a1ce5a, @@ -139,6 +159,7 @@ enum { mtpc_messageActionChatDeletePhoto = 0x95e3fbef, mtpc_messageActionChatAddUser = 0x5e3cfc4b, mtpc_messageActionChatDeleteUser = 0xb2ae9b0c, + mtpc_messageActionChatJoinedByLink = 0xf89cf5e8, mtpc_dialog = 0xc1dd804a, mtpc_photoEmpty = 0x2331b22d, mtpc_photo = 0xcded42fe, @@ -151,6 +172,7 @@ enum { mtpc_geoPoint = 0x2049d70c, mtpc_auth_checkedPhone = 0x811ea28e, mtpc_auth_sentCode = 0xefed51d9, + mtpc_auth_sentAppCode = 0xe325edcf, mtpc_auth_authorization = 0xff036af1, mtpc_auth_exportedAuthorization = 0xdf969c2d, mtpc_inputNotifyPeer = 0xb8bc5b0c, @@ -165,6 +187,7 @@ enum { mtpc_peerNotifySettingsEmpty = 0x70a68512, mtpc_peerNotifySettings = 0x8d5e11ee, mtpc_wallPaper = 0xccb03657, + mtpc_wallPaperSolid = 0x63117f24, mtpc_userFull = 0x5a89ac5b, mtpc_contact = 0xf911c994, mtpc_importedContact = 0xd0028438, @@ -206,6 +229,22 @@ enum { mtpc_updateContactRegistered = 0x2575bbb9, mtpc_updateContactLink = 0x9d2e67c5, mtpc_updateNewAuthorization = 0x8f06529a, + mtpc_updateNewEncryptedMessage = 0x12bcbd9a, + mtpc_updateEncryptedChatTyping = 0x1710f156, + mtpc_updateEncryption = 0xb4a2e88d, + mtpc_updateEncryptedMessagesRead = 0x38fe25b7, + mtpc_updateChatParticipantAdd = 0xea4b0e5c, + mtpc_updateChatParticipantDelete = 0x6e5f8c22, + mtpc_updateDcOptions = 0x8e5e9873, + mtpc_updateUserBlocked = 0x80ece81a, + mtpc_updateNotifySettings = 0xbec268ef, + mtpc_updateServiceNotification = 0x382dd3e4, + mtpc_updatePrivacy = 0xee3b272a, + mtpc_updateUserPhone = 0x12b9417b, + mtpc_updateReadHistoryInbox = 0x9961fd5c, + mtpc_updateReadHistoryOutbox = 0x2f2f21bf, + mtpc_updateWebPage = 0x2cc36971, + mtpc_updateReadMessagesContents = 0x68c13933, mtpc_updates_state = 0xa56c2a3e, mtpc_updates_differenceEmpty = 0x5d75a138, mtpc_updates_difference = 0xf49ca0, @@ -216,6 +255,7 @@ enum { mtpc_updateShort = 0x78d4dec1, mtpc_updatesCombined = 0x725b04c3, mtpc_updates = 0x74ae4240, + mtpc_updateShortSentMessage = 0x11f1331c, mtpc_photos_photos = 0x8dca6aa5, mtpc_photos_photosSlice = 0x15051f54, mtpc_photos_photo = 0x20212ca8, @@ -226,11 +266,6 @@ enum { mtpc_help_appUpdate = 0x8987f311, mtpc_help_noAppUpdate = 0xc45a6536, mtpc_help_inviteText = 0x18cb9f78, - mtpc_wallPaperSolid = 0x63117f24, - mtpc_updateNewEncryptedMessage = 0x12bcbd9a, - mtpc_updateEncryptedChatTyping = 0x1710f156, - mtpc_updateEncryption = 0xb4a2e88d, - mtpc_updateEncryptedMessagesRead = 0x38fe25b7, mtpc_encryptedChatEmpty = 0xab7ec0a0, mtpc_encryptedChatWaiting = 0x3bf703dc, mtpc_encryptedChatRequested = 0xc878527e, @@ -242,31 +277,17 @@ enum { mtpc_inputEncryptedFileEmpty = 0x1837c364, mtpc_inputEncryptedFileUploaded = 0x64bd0306, mtpc_inputEncryptedFile = 0x5a17b5e5, - mtpc_inputEncryptedFileLocation = 0xf5235d55, + mtpc_inputEncryptedFileBigUploaded = 0x2dc173c8, mtpc_encryptedMessage = 0xed18c118, mtpc_encryptedMessageService = 0x23734b06, mtpc_messages_dhConfigNotModified = 0xc0e24635, mtpc_messages_dhConfig = 0x2c221edd, mtpc_messages_sentEncryptedMessage = 0x560f8935, mtpc_messages_sentEncryptedFile = 0x9493ff32, - mtpc_inputFileBig = 0xfa4f0bb5, - mtpc_inputEncryptedFileBigUploaded = 0x2dc173c8, - mtpc_updateChatParticipantAdd = 0x3a0eeb22, - mtpc_updateChatParticipantDelete = 0x6e5f8c22, - mtpc_updateDcOptions = 0x8e5e9873, - mtpc_inputMediaUploadedAudio = 0x4e498cab, - mtpc_inputMediaAudio = 0x89938781, - mtpc_inputMediaUploadedDocument = 0xffe76b78, - mtpc_inputMediaUploadedThumbDocument = 0x41481486, - mtpc_inputMediaDocument = 0xd184e841, - mtpc_messageMediaDocument = 0x2fda2204, - mtpc_messageMediaAudio = 0xc6b68300, mtpc_inputAudioEmpty = 0xd95adc84, mtpc_inputAudio = 0x77d440ff, mtpc_inputDocumentEmpty = 0x72f0eaae, mtpc_inputDocument = 0x18798952, - mtpc_inputAudioFileLocation = 0x74dc404d, - mtpc_inputDocumentFileLocation = 0x4e45abe9, mtpc_audioEmpty = 0x586988d8, mtpc_audio = 0xf9e35055, mtpc_documentEmpty = 0x36f8c871, @@ -276,9 +297,6 @@ enum { mtpc_notifyUsers = 0xb4c83b4c, mtpc_notifyChats = 0xc007cec3, mtpc_notifyAll = 0x74d07c60, - mtpc_updateUserBlocked = 0x80ece81a, - mtpc_updateNotifySettings = 0xbec268ef, - mtpc_auth_sentAppCode = 0xe325edcf, mtpc_sendMessageTypingAction = 0x16bf744e, mtpc_sendMessageCancelAction = 0xfd5ec8f5, mtpc_sendMessageRecordVideoAction = 0xa187d66f, @@ -291,11 +309,6 @@ enum { mtpc_sendMessageChooseContactAction = 0x628cbc6f, mtpc_contactFound = 0xea879f95, mtpc_contacts_found = 0x566000e, - mtpc_updateServiceNotification = 0x382dd3e4, - mtpc_userStatusRecently = 0xe26f42f1, - mtpc_userStatusLastWeek = 0x7bf09fc, - mtpc_userStatusLastMonth = 0x77ebc742, - mtpc_updatePrivacy = 0xee3b272a, mtpc_inputPrivacyKeyStatusTimestamp = 0x4f96cb18, mtpc_privacyKeyStatusTimestamp = 0xbc2eab30, mtpc_inputPrivacyValueAllowContacts = 0xd09e07b, @@ -313,7 +326,6 @@ enum { mtpc_account_privacyRules = 0x554abb6f, mtpc_accountDaysTTL = 0xb8d0afdf, mtpc_account_sentChangePhoneCode = 0xa4f58c4c, - mtpc_updateUserPhone = 0x12b9417b, mtpc_documentAttributeImageSize = 0x6c37c15c, mtpc_documentAttributeAnimated = 0x11b58939, mtpc_documentAttributeSticker = 0x3a556302, @@ -326,18 +338,14 @@ enum { mtpc_messages_allStickersNotModified = 0xe86602c3, mtpc_messages_allStickers = 0xd51dafdb, mtpc_disabledFeature = 0xae636f24, - mtpc_updateReadHistoryInbox = 0x9961fd5c, - mtpc_updateReadHistoryOutbox = 0x2f2f21bf, mtpc_messages_affectedMessages = 0x84d19185, mtpc_contactLinkUnknown = 0x5f4f9247, mtpc_contactLinkNone = 0xfeedd3ad, mtpc_contactLinkHasPhone = 0x268f3f59, mtpc_contactLinkContact = 0xd502c2d0, - mtpc_updateWebPage = 0x2cc36971, mtpc_webPageEmpty = 0xeb1477e8, mtpc_webPagePending = 0xc586da1c, mtpc_webPage = 0xca820ed7, - mtpc_messageMediaWebPage = 0xa32dd600, mtpc_authorization = 0x7bf2e6f6, mtpc_account_authorizations = 0x1250abde, mtpc_account_noPassword = 0x96dabc18, @@ -345,21 +353,16 @@ enum { mtpc_account_passwordSettings = 0xb7b72ab3, mtpc_account_passwordInputSettings = 0xbcfc532c, mtpc_auth_passwordRecovery = 0x137948a5, - mtpc_inputMediaVenue = 0x2827a81a, - mtpc_messageMediaVenue = 0x7912b71f, mtpc_receivedNotifyMessage = 0xa384b779, mtpc_chatInviteEmpty = 0x69df3769, mtpc_chatInviteExported = 0xfc2e05bc, mtpc_chatInviteAlready = 0x5a686d7c, mtpc_chatInvite = 0xce917dcd, - mtpc_messageActionChatJoinedByLink = 0xf89cf5e8, - mtpc_updateReadMessagesContents = 0x68c13933, mtpc_inputStickerSetEmpty = 0xffb62b95, mtpc_inputStickerSetID = 0x9de7a269, mtpc_inputStickerSetShortName = 0x861cc8a0, mtpc_stickerSet = 0xcd303b41, mtpc_messages_stickerSet = 0xb60a24a6, - mtpc_user = 0x22e49072, mtpc_botCommand = 0xc27ac8c7, mtpc_botInfoEmpty = 0xbb2e37ce, mtpc_botInfo = 0x9cf585d, @@ -368,8 +371,6 @@ enum { mtpc_replyKeyboardHide = 0xa03e5b85, mtpc_replyKeyboardForceReply = 0xf4108aa0, mtpc_replyKeyboardMarkup = 0x3502758c, - mtpc_inputPeerUser = 0x7b8e7de6, - mtpc_inputUser = 0xd8292816, mtpc_help_appChangelogEmpty = 0xaf7e0394, mtpc_help_appChangelog = 0x4668e6bd, mtpc_messageEntityUnknown = 0xbb92ba95, @@ -383,9 +384,11 @@ enum { mtpc_messageEntityCode = 0x28a20571, mtpc_messageEntityPre = 0x73924be0, mtpc_messageEntityTextUrl = 0x76a6d327, - mtpc_updateShortSentMessage = 0x11f1331c, 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, @@ -397,6 +400,11 @@ 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_account_registerDevice = 0x446c712c, mtpc_account_unregisterDevice = 0x65c55b40, mtpc_account_updateNotifySettings = 0x84be5b93, @@ -405,6 +413,21 @@ enum { mtpc_account_updateProfile = 0xf0888d68, mtpc_account_updateStatus = 0x6628562c, mtpc_account_getWallPapers = 0xc04cfac2, + mtpc_account_checkUsername = 0x2714d86c, + mtpc_account_updateUsername = 0x3e0bdd7c, + mtpc_account_getPrivacy = 0xdadbc950, + mtpc_account_setPrivacy = 0xc9f81ce8, + mtpc_account_deleteAccount = 0x418d4e0b, + mtpc_account_getAccountTTL = 0x8fc711d, + mtpc_account_setAccountTTL = 0x2442485e, + mtpc_account_sendChangePhoneCode = 0xa407a8f4, + mtpc_account_changePhone = 0x70c32edb, + mtpc_account_updateDeviceLocked = 0x38df3532, + mtpc_account_getAuthorizations = 0xe320c158, + mtpc_account_resetAuthorization = 0xdf77f3bc, + mtpc_account_getPassword = 0x548a30f5, + mtpc_account_getPasswordSettings = 0xbc8d11bb, + mtpc_account_updatePasswordSettings = 0xfa7c4b86, mtpc_users_getUsers = 0xd91a548, mtpc_users_getFullUser = 0xca30a5b1, mtpc_contacts_getStatuses = 0xc4a353ee, @@ -418,6 +441,8 @@ enum { mtpc_contacts_getBlocked = 0xf57c350f, mtpc_contacts_exportCard = 0x84e53737, mtpc_contacts_importCard = 0x4fe196fe, + mtpc_contacts_search = 0x11f812d8, + mtpc_contacts_resolveUsername = 0xbf0131c, mtpc_messages_getMessages = 0x4222fa74, mtpc_messages_getDialogs = 0xeccf1df6, mtpc_messages_getHistory = 0x92a1df2f, @@ -437,19 +462,6 @@ enum { mtpc_messages_addChatUser = 0xf9a0aa09, mtpc_messages_deleteChatUser = 0xe0611f16, mtpc_messages_createChat = 0x9cb126e, - mtpc_updates_getState = 0xedd4882a, - mtpc_updates_getDifference = 0xa041495, - mtpc_photos_updateProfilePhoto = 0xeef579a0, - mtpc_photos_uploadProfilePhoto = 0xd50f9c88, - mtpc_photos_deletePhotos = 0x87cf7f2f, - mtpc_upload_saveFilePart = 0xb304a621, - mtpc_upload_getFile = 0xe3a6cfb5, - mtpc_help_getConfig = 0xc4f9186b, - mtpc_help_getNearestDc = 0x1fb33026, - mtpc_help_getAppUpdate = 0xc812ac7e, - mtpc_help_saveAppLog = 0x6f02f748, - mtpc_help_getInviteText = 0xa4a95186, - mtpc_photos_getUserPhotos = 0x91cd32a8, mtpc_messages_forwardMessage = 0x33963bf9, mtpc_messages_sendBroadcast = 0xbf73f4da, mtpc_messages_getDhConfig = 0x26cf8950, @@ -462,37 +474,10 @@ enum { mtpc_messages_sendEncryptedFile = 0x9a901b66, mtpc_messages_sendEncryptedService = 0x32d439a4, mtpc_messages_receivedQueue = 0x55a5bb66, - mtpc_upload_saveBigFilePart = 0xde7b673d, - mtpc_initConnection = 0x69796de9, - mtpc_help_getSupport = 0x9cdf08cd, - mtpc_auth_sendSms = 0xda9f3e8, mtpc_messages_readMessageContents = 0x36a73f77, - mtpc_account_checkUsername = 0x2714d86c, - mtpc_account_updateUsername = 0x3e0bdd7c, - mtpc_contacts_search = 0x11f812d8, - mtpc_account_getPrivacy = 0xdadbc950, - mtpc_account_setPrivacy = 0xc9f81ce8, - mtpc_account_deleteAccount = 0x418d4e0b, - mtpc_account_getAccountTTL = 0x8fc711d, - mtpc_account_setAccountTTL = 0x2442485e, - mtpc_invokeWithLayer = 0xda9b0d0d, - mtpc_contacts_resolveUsername = 0xbf0131c, - mtpc_account_sendChangePhoneCode = 0xa407a8f4, - mtpc_account_changePhone = 0x70c32edb, mtpc_messages_getStickers = 0xae22e045, mtpc_messages_getAllStickers = 0xaa3bc868, - mtpc_account_updateDeviceLocked = 0x38df3532, - mtpc_auth_importBotAuthorization = 0x67a3ff2c, mtpc_messages_getWebPagePreview = 0x25223e24, - mtpc_account_getAuthorizations = 0xe320c158, - mtpc_account_resetAuthorization = 0xdf77f3bc, - mtpc_account_getPassword = 0x548a30f5, - mtpc_account_getPasswordSettings = 0xbc8d11bb, - mtpc_account_updatePasswordSettings = 0xfa7c4b86, - mtpc_auth_checkPassword = 0xa63011e, - mtpc_auth_requestPasswordRecovery = 0xd897bc66, - mtpc_auth_recoverPassword = 0x4ea56e92, - mtpc_invokeWithoutUpdates = 0xbf9459b7, mtpc_messages_exportChatInvite = 0x7d885289, mtpc_messages_checkChatInvite = 0x3eadb1bb, mtpc_messages_importChatInvite = 0x6c50051c, @@ -500,6 +485,22 @@ enum { mtpc_messages_installStickerSet = 0x7b30c3a6, mtpc_messages_uninstallStickerSet = 0xf96e55de, mtpc_messages_startBot = 0x1b3e0ffc, + mtpc_messages_reportSpam = 0xcf1592db, + mtpc_updates_getState = 0xedd4882a, + mtpc_updates_getDifference = 0xa041495, + mtpc_photos_updateProfilePhoto = 0xeef579a0, + mtpc_photos_uploadProfilePhoto = 0xd50f9c88, + mtpc_photos_deletePhotos = 0x87cf7f2f, + mtpc_photos_getUserPhotos = 0x91cd32a8, + mtpc_upload_saveFilePart = 0xb304a621, + mtpc_upload_getFile = 0xe3a6cfb5, + mtpc_upload_saveBigFilePart = 0xde7b673d, + mtpc_help_getConfig = 0xc4f9186b, + mtpc_help_getNearestDc = 0x1fb33026, + mtpc_help_getAppUpdate = 0xc812ac7e, + mtpc_help_saveAppLog = 0x6f02f748, + mtpc_help_getInviteText = 0xa4a95186, + mtpc_help_getSupport = 0x9cdf08cd, mtpc_help_getAppChangelog = 0x5bab7fb2 }; @@ -3183,7 +3184,7 @@ private: explicit MTPchatParticipants(MTPDchatParticipantsForbidden *_data); explicit MTPchatParticipants(MTPDchatParticipants *_data); - friend MTPchatParticipants MTP_chatParticipantsForbidden(MTPint _chat_id); + friend MTPchatParticipants MTP_chatParticipantsForbidden(MTPint _flags, MTPint _chat_id, const MTPChatParticipant &_self_participant); friend MTPchatParticipants MTP_chatParticipants(MTPint _chat_id, MTPint _admin_id, const MTPVector &_participants, MTPint _version); mtpTypeId _type; @@ -5122,7 +5123,7 @@ private: 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 _version); + 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); @@ -8737,10 +8738,18 @@ class MTPDchatParticipantsForbidden : public mtpDataImpl { @@ -9627,12 +9636,13 @@ class MTPDupdateChatParticipantAdd : public mtpDataImpl +class MTPinitConnection { // RPC method 'initConnection' +public: + MTPint vapi_id; + MTPstring vdevice_model; + MTPstring vsystem_version; + MTPstring vapp_version; + MTPstring vlang_code; + TQueryType vquery; + + MTPinitConnection() { + } + MTPinitConnection(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_initConnection) { + read(from, end, cons); + } + MTPinitConnection(MTPint _api_id, const MTPstring &_device_model, const MTPstring &_system_version, const MTPstring &_app_version, const MTPstring &_lang_code, const TQueryType &_query) : vapi_id(_api_id), vdevice_model(_device_model), vsystem_version(_system_version), vapp_version(_app_version), vlang_code(_lang_code), vquery(_query) { + } + + uint32 innerLength() const { + return vapi_id.innerLength() + vdevice_model.innerLength() + vsystem_version.innerLength() + vapp_version.innerLength() + vlang_code.innerLength() + vquery.innerLength(); + } + mtpTypeId type() const { + return mtpc_initConnection; + } + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_initConnection) { + vapi_id.read(from, end); + vdevice_model.read(from, end); + vsystem_version.read(from, end); + vapp_version.read(from, end); + vlang_code.read(from, end); + vquery.read(from, end); + } + void write(mtpBuffer &to) const { + vapi_id.write(to); + vdevice_model.write(to); + vsystem_version.write(to); + vapp_version.write(to); + vlang_code.write(to); + vquery.write(to); + } + + typedef typename TQueryType::ResponseType ResponseType; +}; +template +class MTPInitConnection : public MTPBoxed > { +public: + MTPInitConnection() { + } + MTPInitConnection(const MTPinitConnection &v) : MTPBoxed >(v) { + } + MTPInitConnection(MTPint _api_id, const MTPstring &_device_model, const MTPstring &_system_version, const MTPstring &_app_version, const MTPstring &_lang_code, const TQueryType &_query) : MTPBoxed >(MTPinitConnection(_api_id, _device_model, _system_version, _app_version, _lang_code, _query)) { + } +}; + +template +class MTPinvokeWithLayer { // RPC method 'invokeWithLayer' +public: + MTPint vlayer; + TQueryType vquery; + + MTPinvokeWithLayer() { + } + MTPinvokeWithLayer(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_invokeWithLayer) { + read(from, end, cons); + } + MTPinvokeWithLayer(MTPint _layer, const TQueryType &_query) : vlayer(_layer), vquery(_query) { + } + + uint32 innerLength() const { + return vlayer.innerLength() + vquery.innerLength(); + } + mtpTypeId type() const { + return mtpc_invokeWithLayer; + } + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_invokeWithLayer) { + vlayer.read(from, end); + vquery.read(from, end); + } + void write(mtpBuffer &to) const { + vlayer.write(to); + vquery.write(to); + } + + typedef typename TQueryType::ResponseType ResponseType; +}; +template +class MTPInvokeWithLayer : public MTPBoxed > { +public: + MTPInvokeWithLayer() { + } + MTPInvokeWithLayer(const MTPinvokeWithLayer &v) : MTPBoxed >(v) { + } + MTPInvokeWithLayer(MTPint _layer, const TQueryType &_query) : MTPBoxed >(MTPinvokeWithLayer(_layer, _query)) { + } +}; + +template +class MTPinvokeWithoutUpdates { // RPC method 'invokeWithoutUpdates' +public: + TQueryType vquery; + + MTPinvokeWithoutUpdates() { + } + MTPinvokeWithoutUpdates(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_invokeWithoutUpdates) { + read(from, end, cons); + } + MTPinvokeWithoutUpdates(const TQueryType &_query) : vquery(_query) { + } + + uint32 innerLength() const { + return vquery.innerLength(); + } + mtpTypeId type() const { + return mtpc_invokeWithoutUpdates; + } + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_invokeWithoutUpdates) { + vquery.read(from, end); + } + void write(mtpBuffer &to) const { + vquery.write(to); + } + + typedef typename TQueryType::ResponseType ResponseType; +}; +template +class MTPInvokeWithoutUpdates : public MTPBoxed > { +public: + MTPInvokeWithoutUpdates() { + } + MTPInvokeWithoutUpdates(const MTPinvokeWithoutUpdates &v) : MTPBoxed >(v) { + } + MTPInvokeWithoutUpdates(const TQueryType &_query) : MTPBoxed >(MTPinvokeWithoutUpdates(_query)) { + } +}; + class MTPauth_checkPhone { // RPC method 'auth.checkPhone' public: MTPstring vphone_number; @@ -12015,6 +12160,205 @@ 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; + MTPint vapi_id; + MTPstring vapi_hash; + MTPstring vbot_auth_token; + + MTPauth_importBotAuthorization() { + } + MTPauth_importBotAuthorization(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_auth_importBotAuthorization) { + read(from, end, cons); + } + MTPauth_importBotAuthorization(MTPint _flags, MTPint _api_id, const MTPstring &_api_hash, const MTPstring &_bot_auth_token) : vflags(_flags), vapi_id(_api_id), vapi_hash(_api_hash), vbot_auth_token(_bot_auth_token) { + } + + uint32 innerLength() const { + return vflags.innerLength() + vapi_id.innerLength() + vapi_hash.innerLength() + vbot_auth_token.innerLength(); + } + mtpTypeId type() const { + return mtpc_auth_importBotAuthorization; + } + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_auth_importBotAuthorization) { + vflags.read(from, end); + vapi_id.read(from, end); + vapi_hash.read(from, end); + vbot_auth_token.read(from, end); + } + void write(mtpBuffer &to) const { + vflags.write(to); + vapi_id.write(to); + vapi_hash.write(to); + vbot_auth_token.write(to); + } + + typedef MTPauth_Authorization ResponseType; +}; +class MTPauth_ImportBotAuthorization : public MTPBoxed { +public: + MTPauth_ImportBotAuthorization() { + } + MTPauth_ImportBotAuthorization(const MTPauth_importBotAuthorization &v) : MTPBoxed(v) { + } + MTPauth_ImportBotAuthorization(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { + } + MTPauth_ImportBotAuthorization(MTPint _flags, MTPint _api_id, const MTPstring &_api_hash, const MTPstring &_bot_auth_token) : MTPBoxed(MTPauth_importBotAuthorization(_flags, _api_id, _api_hash, _bot_auth_token)) { + } +}; + +class MTPauth_checkPassword { // RPC method 'auth.checkPassword' +public: + MTPbytes vpassword_hash; + + MTPauth_checkPassword() { + } + MTPauth_checkPassword(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_auth_checkPassword) { + read(from, end, cons); + } + MTPauth_checkPassword(const MTPbytes &_password_hash) : vpassword_hash(_password_hash) { + } + + uint32 innerLength() const { + return vpassword_hash.innerLength(); + } + mtpTypeId type() const { + return mtpc_auth_checkPassword; + } + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_auth_checkPassword) { + vpassword_hash.read(from, end); + } + void write(mtpBuffer &to) const { + vpassword_hash.write(to); + } + + typedef MTPauth_Authorization ResponseType; +}; +class MTPauth_CheckPassword : public MTPBoxed { +public: + MTPauth_CheckPassword() { + } + MTPauth_CheckPassword(const MTPauth_checkPassword &v) : MTPBoxed(v) { + } + MTPauth_CheckPassword(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { + } + MTPauth_CheckPassword(const MTPbytes &_password_hash) : MTPBoxed(MTPauth_checkPassword(_password_hash)) { + } +}; + +class MTPauth_requestPasswordRecovery { // RPC method 'auth.requestPasswordRecovery' +public: + MTPauth_requestPasswordRecovery() { + } + MTPauth_requestPasswordRecovery(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_auth_requestPasswordRecovery) { + read(from, end, cons); + } + + uint32 innerLength() const { + return 0; + } + mtpTypeId type() const { + return mtpc_auth_requestPasswordRecovery; + } + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_auth_requestPasswordRecovery) { + } + void write(mtpBuffer &to) const { + } + + typedef MTPauth_PasswordRecovery ResponseType; +}; +class MTPauth_RequestPasswordRecovery : public MTPBoxed { +public: + MTPauth_RequestPasswordRecovery() { + } + MTPauth_RequestPasswordRecovery(const MTPauth_requestPasswordRecovery &v) : MTPBoxed(v) { + } + MTPauth_RequestPasswordRecovery(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { + } +}; + +class MTPauth_recoverPassword { // RPC method 'auth.recoverPassword' +public: + MTPstring vcode; + + MTPauth_recoverPassword() { + } + MTPauth_recoverPassword(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_auth_recoverPassword) { + read(from, end, cons); + } + MTPauth_recoverPassword(const MTPstring &_code) : vcode(_code) { + } + + uint32 innerLength() const { + return vcode.innerLength(); + } + mtpTypeId type() const { + return mtpc_auth_recoverPassword; + } + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_auth_recoverPassword) { + vcode.read(from, end); + } + void write(mtpBuffer &to) const { + vcode.write(to); + } + + typedef MTPauth_Authorization ResponseType; +}; +class MTPauth_RecoverPassword : public MTPBoxed { +public: + MTPauth_RecoverPassword() { + } + MTPauth_RecoverPassword(const MTPauth_recoverPassword &v) : MTPBoxed(v) { + } + MTPauth_RecoverPassword(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { + } + MTPauth_RecoverPassword(const MTPstring &_code) : MTPBoxed(MTPauth_recoverPassword(_code)) { + } +}; + class MTPaccount_registerDevice { // RPC method 'account.registerDevice' public: MTPint vtoken_type; @@ -12338,6 +12682,579 @@ public: } }; +class MTPaccount_checkUsername { // RPC method 'account.checkUsername' +public: + MTPstring vusername; + + MTPaccount_checkUsername() { + } + MTPaccount_checkUsername(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_account_checkUsername) { + read(from, end, cons); + } + MTPaccount_checkUsername(const MTPstring &_username) : vusername(_username) { + } + + uint32 innerLength() const { + return vusername.innerLength(); + } + mtpTypeId type() const { + return mtpc_account_checkUsername; + } + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_account_checkUsername) { + vusername.read(from, end); + } + void write(mtpBuffer &to) const { + vusername.write(to); + } + + typedef MTPBool ResponseType; +}; +class MTPaccount_CheckUsername : public MTPBoxed { +public: + MTPaccount_CheckUsername() { + } + MTPaccount_CheckUsername(const MTPaccount_checkUsername &v) : MTPBoxed(v) { + } + MTPaccount_CheckUsername(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { + } + MTPaccount_CheckUsername(const MTPstring &_username) : MTPBoxed(MTPaccount_checkUsername(_username)) { + } +}; + +class MTPaccount_updateUsername { // RPC method 'account.updateUsername' +public: + MTPstring vusername; + + MTPaccount_updateUsername() { + } + MTPaccount_updateUsername(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_account_updateUsername) { + read(from, end, cons); + } + MTPaccount_updateUsername(const MTPstring &_username) : vusername(_username) { + } + + uint32 innerLength() const { + return vusername.innerLength(); + } + mtpTypeId type() const { + return mtpc_account_updateUsername; + } + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_account_updateUsername) { + vusername.read(from, end); + } + void write(mtpBuffer &to) const { + vusername.write(to); + } + + typedef MTPUser ResponseType; +}; +class MTPaccount_UpdateUsername : public MTPBoxed { +public: + MTPaccount_UpdateUsername() { + } + MTPaccount_UpdateUsername(const MTPaccount_updateUsername &v) : MTPBoxed(v) { + } + MTPaccount_UpdateUsername(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { + } + MTPaccount_UpdateUsername(const MTPstring &_username) : MTPBoxed(MTPaccount_updateUsername(_username)) { + } +}; + +class MTPaccount_getPrivacy { // RPC method 'account.getPrivacy' +public: + MTPInputPrivacyKey vkey; + + MTPaccount_getPrivacy() { + } + MTPaccount_getPrivacy(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_account_getPrivacy) { + read(from, end, cons); + } + MTPaccount_getPrivacy(const MTPInputPrivacyKey &_key) : vkey(_key) { + } + + uint32 innerLength() const { + return vkey.innerLength(); + } + mtpTypeId type() const { + return mtpc_account_getPrivacy; + } + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_account_getPrivacy) { + vkey.read(from, end); + } + void write(mtpBuffer &to) const { + vkey.write(to); + } + + typedef MTPaccount_PrivacyRules ResponseType; +}; +class MTPaccount_GetPrivacy : public MTPBoxed { +public: + MTPaccount_GetPrivacy() { + } + MTPaccount_GetPrivacy(const MTPaccount_getPrivacy &v) : MTPBoxed(v) { + } + MTPaccount_GetPrivacy(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { + } + MTPaccount_GetPrivacy(const MTPInputPrivacyKey &_key) : MTPBoxed(MTPaccount_getPrivacy(_key)) { + } +}; + +class MTPaccount_setPrivacy { // RPC method 'account.setPrivacy' +public: + MTPInputPrivacyKey vkey; + MTPVector vrules; + + MTPaccount_setPrivacy() { + } + MTPaccount_setPrivacy(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_account_setPrivacy) { + read(from, end, cons); + } + MTPaccount_setPrivacy(const MTPInputPrivacyKey &_key, const MTPVector &_rules) : vkey(_key), vrules(_rules) { + } + + uint32 innerLength() const { + return vkey.innerLength() + vrules.innerLength(); + } + mtpTypeId type() const { + return mtpc_account_setPrivacy; + } + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_account_setPrivacy) { + vkey.read(from, end); + vrules.read(from, end); + } + void write(mtpBuffer &to) const { + vkey.write(to); + vrules.write(to); + } + + typedef MTPaccount_PrivacyRules ResponseType; +}; +class MTPaccount_SetPrivacy : public MTPBoxed { +public: + MTPaccount_SetPrivacy() { + } + MTPaccount_SetPrivacy(const MTPaccount_setPrivacy &v) : MTPBoxed(v) { + } + MTPaccount_SetPrivacy(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { + } + MTPaccount_SetPrivacy(const MTPInputPrivacyKey &_key, const MTPVector &_rules) : MTPBoxed(MTPaccount_setPrivacy(_key, _rules)) { + } +}; + +class MTPaccount_deleteAccount { // RPC method 'account.deleteAccount' +public: + MTPstring vreason; + + MTPaccount_deleteAccount() { + } + MTPaccount_deleteAccount(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_account_deleteAccount) { + read(from, end, cons); + } + MTPaccount_deleteAccount(const MTPstring &_reason) : vreason(_reason) { + } + + uint32 innerLength() const { + return vreason.innerLength(); + } + mtpTypeId type() const { + return mtpc_account_deleteAccount; + } + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_account_deleteAccount) { + vreason.read(from, end); + } + void write(mtpBuffer &to) const { + vreason.write(to); + } + + typedef MTPBool ResponseType; +}; +class MTPaccount_DeleteAccount : public MTPBoxed { +public: + MTPaccount_DeleteAccount() { + } + MTPaccount_DeleteAccount(const MTPaccount_deleteAccount &v) : MTPBoxed(v) { + } + MTPaccount_DeleteAccount(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { + } + MTPaccount_DeleteAccount(const MTPstring &_reason) : MTPBoxed(MTPaccount_deleteAccount(_reason)) { + } +}; + +class MTPaccount_getAccountTTL { // RPC method 'account.getAccountTTL' +public: + MTPaccount_getAccountTTL() { + } + MTPaccount_getAccountTTL(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_account_getAccountTTL) { + read(from, end, cons); + } + + uint32 innerLength() const { + return 0; + } + mtpTypeId type() const { + return mtpc_account_getAccountTTL; + } + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_account_getAccountTTL) { + } + void write(mtpBuffer &to) const { + } + + typedef MTPAccountDaysTTL ResponseType; +}; +class MTPaccount_GetAccountTTL : public MTPBoxed { +public: + MTPaccount_GetAccountTTL() { + } + MTPaccount_GetAccountTTL(const MTPaccount_getAccountTTL &v) : MTPBoxed(v) { + } + MTPaccount_GetAccountTTL(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { + } +}; + +class MTPaccount_setAccountTTL { // RPC method 'account.setAccountTTL' +public: + MTPAccountDaysTTL vttl; + + MTPaccount_setAccountTTL() { + } + MTPaccount_setAccountTTL(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_account_setAccountTTL) { + read(from, end, cons); + } + MTPaccount_setAccountTTL(const MTPAccountDaysTTL &_ttl) : vttl(_ttl) { + } + + uint32 innerLength() const { + return vttl.innerLength(); + } + mtpTypeId type() const { + return mtpc_account_setAccountTTL; + } + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_account_setAccountTTL) { + vttl.read(from, end); + } + void write(mtpBuffer &to) const { + vttl.write(to); + } + + typedef MTPBool ResponseType; +}; +class MTPaccount_SetAccountTTL : public MTPBoxed { +public: + MTPaccount_SetAccountTTL() { + } + MTPaccount_SetAccountTTL(const MTPaccount_setAccountTTL &v) : MTPBoxed(v) { + } + MTPaccount_SetAccountTTL(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { + } + MTPaccount_SetAccountTTL(const MTPAccountDaysTTL &_ttl) : MTPBoxed(MTPaccount_setAccountTTL(_ttl)) { + } +}; + +class MTPaccount_sendChangePhoneCode { // RPC method 'account.sendChangePhoneCode' +public: + MTPstring vphone_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) { + } + + uint32 innerLength() const { + return vphone_number.innerLength(); + } + mtpTypeId type() const { + return mtpc_account_sendChangePhoneCode; + } + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_account_sendChangePhoneCode) { + vphone_number.read(from, end); + } + void write(mtpBuffer &to) const { + vphone_number.write(to); + } + + typedef MTPaccount_SentChangePhoneCode ResponseType; +}; +class MTPaccount_SendChangePhoneCode : public MTPBoxed { +public: + MTPaccount_SendChangePhoneCode() { + } + MTPaccount_SendChangePhoneCode(const MTPaccount_sendChangePhoneCode &v) : MTPBoxed(v) { + } + 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)) { + } +}; + +class MTPaccount_changePhone { // RPC method 'account.changePhone' +public: + MTPstring vphone_number; + MTPstring vphone_code_hash; + MTPstring vphone_code; + + MTPaccount_changePhone() { + } + MTPaccount_changePhone(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_account_changePhone) { + read(from, end, cons); + } + MTPaccount_changePhone(const MTPstring &_phone_number, const MTPstring &_phone_code_hash, const MTPstring &_phone_code) : vphone_number(_phone_number), vphone_code_hash(_phone_code_hash), vphone_code(_phone_code) { + } + + uint32 innerLength() const { + return vphone_number.innerLength() + vphone_code_hash.innerLength() + vphone_code.innerLength(); + } + mtpTypeId type() const { + return mtpc_account_changePhone; + } + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_account_changePhone) { + vphone_number.read(from, end); + vphone_code_hash.read(from, end); + vphone_code.read(from, end); + } + void write(mtpBuffer &to) const { + vphone_number.write(to); + vphone_code_hash.write(to); + vphone_code.write(to); + } + + typedef MTPUser ResponseType; +}; +class MTPaccount_ChangePhone : public MTPBoxed { +public: + MTPaccount_ChangePhone() { + } + MTPaccount_ChangePhone(const MTPaccount_changePhone &v) : MTPBoxed(v) { + } + MTPaccount_ChangePhone(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { + } + MTPaccount_ChangePhone(const MTPstring &_phone_number, const MTPstring &_phone_code_hash, const MTPstring &_phone_code) : MTPBoxed(MTPaccount_changePhone(_phone_number, _phone_code_hash, _phone_code)) { + } +}; + +class MTPaccount_updateDeviceLocked { // RPC method 'account.updateDeviceLocked' +public: + MTPint vperiod; + + MTPaccount_updateDeviceLocked() { + } + MTPaccount_updateDeviceLocked(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_account_updateDeviceLocked) { + read(from, end, cons); + } + MTPaccount_updateDeviceLocked(MTPint _period) : vperiod(_period) { + } + + uint32 innerLength() const { + return vperiod.innerLength(); + } + mtpTypeId type() const { + return mtpc_account_updateDeviceLocked; + } + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_account_updateDeviceLocked) { + vperiod.read(from, end); + } + void write(mtpBuffer &to) const { + vperiod.write(to); + } + + typedef MTPBool ResponseType; +}; +class MTPaccount_UpdateDeviceLocked : public MTPBoxed { +public: + MTPaccount_UpdateDeviceLocked() { + } + MTPaccount_UpdateDeviceLocked(const MTPaccount_updateDeviceLocked &v) : MTPBoxed(v) { + } + MTPaccount_UpdateDeviceLocked(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { + } + MTPaccount_UpdateDeviceLocked(MTPint _period) : MTPBoxed(MTPaccount_updateDeviceLocked(_period)) { + } +}; + +class MTPaccount_getAuthorizations { // RPC method 'account.getAuthorizations' +public: + MTPaccount_getAuthorizations() { + } + MTPaccount_getAuthorizations(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_account_getAuthorizations) { + read(from, end, cons); + } + + uint32 innerLength() const { + return 0; + } + mtpTypeId type() const { + return mtpc_account_getAuthorizations; + } + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_account_getAuthorizations) { + } + void write(mtpBuffer &to) const { + } + + typedef MTPaccount_Authorizations ResponseType; +}; +class MTPaccount_GetAuthorizations : public MTPBoxed { +public: + MTPaccount_GetAuthorizations() { + } + MTPaccount_GetAuthorizations(const MTPaccount_getAuthorizations &v) : MTPBoxed(v) { + } + MTPaccount_GetAuthorizations(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { + } +}; + +class MTPaccount_resetAuthorization { // RPC method 'account.resetAuthorization' +public: + MTPlong vhash; + + MTPaccount_resetAuthorization() { + } + MTPaccount_resetAuthorization(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_account_resetAuthorization) { + read(from, end, cons); + } + MTPaccount_resetAuthorization(const MTPlong &_hash) : vhash(_hash) { + } + + uint32 innerLength() const { + return vhash.innerLength(); + } + mtpTypeId type() const { + return mtpc_account_resetAuthorization; + } + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_account_resetAuthorization) { + vhash.read(from, end); + } + void write(mtpBuffer &to) const { + vhash.write(to); + } + + typedef MTPBool ResponseType; +}; +class MTPaccount_ResetAuthorization : public MTPBoxed { +public: + MTPaccount_ResetAuthorization() { + } + MTPaccount_ResetAuthorization(const MTPaccount_resetAuthorization &v) : MTPBoxed(v) { + } + MTPaccount_ResetAuthorization(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { + } + MTPaccount_ResetAuthorization(const MTPlong &_hash) : MTPBoxed(MTPaccount_resetAuthorization(_hash)) { + } +}; + +class MTPaccount_getPassword { // RPC method 'account.getPassword' +public: + MTPaccount_getPassword() { + } + MTPaccount_getPassword(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_account_getPassword) { + read(from, end, cons); + } + + uint32 innerLength() const { + return 0; + } + mtpTypeId type() const { + return mtpc_account_getPassword; + } + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_account_getPassword) { + } + void write(mtpBuffer &to) const { + } + + typedef MTPaccount_Password ResponseType; +}; +class MTPaccount_GetPassword : public MTPBoxed { +public: + MTPaccount_GetPassword() { + } + MTPaccount_GetPassword(const MTPaccount_getPassword &v) : MTPBoxed(v) { + } + MTPaccount_GetPassword(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { + } +}; + +class MTPaccount_getPasswordSettings { // RPC method 'account.getPasswordSettings' +public: + MTPbytes vcurrent_password_hash; + + MTPaccount_getPasswordSettings() { + } + MTPaccount_getPasswordSettings(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_account_getPasswordSettings) { + read(from, end, cons); + } + MTPaccount_getPasswordSettings(const MTPbytes &_current_password_hash) : vcurrent_password_hash(_current_password_hash) { + } + + uint32 innerLength() const { + return vcurrent_password_hash.innerLength(); + } + mtpTypeId type() const { + return mtpc_account_getPasswordSettings; + } + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_account_getPasswordSettings) { + vcurrent_password_hash.read(from, end); + } + void write(mtpBuffer &to) const { + vcurrent_password_hash.write(to); + } + + typedef MTPaccount_PasswordSettings ResponseType; +}; +class MTPaccount_GetPasswordSettings : public MTPBoxed { +public: + MTPaccount_GetPasswordSettings() { + } + MTPaccount_GetPasswordSettings(const MTPaccount_getPasswordSettings &v) : MTPBoxed(v) { + } + MTPaccount_GetPasswordSettings(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { + } + MTPaccount_GetPasswordSettings(const MTPbytes &_current_password_hash) : MTPBoxed(MTPaccount_getPasswordSettings(_current_password_hash)) { + } +}; + +class MTPaccount_updatePasswordSettings { // RPC method 'account.updatePasswordSettings' +public: + MTPbytes vcurrent_password_hash; + MTPaccount_PasswordInputSettings vnew_settings; + + MTPaccount_updatePasswordSettings() { + } + MTPaccount_updatePasswordSettings(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_account_updatePasswordSettings) { + read(from, end, cons); + } + MTPaccount_updatePasswordSettings(const MTPbytes &_current_password_hash, const MTPaccount_PasswordInputSettings &_new_settings) : vcurrent_password_hash(_current_password_hash), vnew_settings(_new_settings) { + } + + uint32 innerLength() const { + return vcurrent_password_hash.innerLength() + vnew_settings.innerLength(); + } + mtpTypeId type() const { + return mtpc_account_updatePasswordSettings; + } + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_account_updatePasswordSettings) { + vcurrent_password_hash.read(from, end); + vnew_settings.read(from, end); + } + void write(mtpBuffer &to) const { + vcurrent_password_hash.write(to); + vnew_settings.write(to); + } + + typedef MTPBool ResponseType; +}; +class MTPaccount_UpdatePasswordSettings : public MTPBoxed { +public: + MTPaccount_UpdatePasswordSettings() { + } + MTPaccount_UpdatePasswordSettings(const MTPaccount_updatePasswordSettings &v) : MTPBoxed(v) { + } + MTPaccount_UpdatePasswordSettings(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { + } + MTPaccount_UpdatePasswordSettings(const MTPbytes &_current_password_hash, const MTPaccount_PasswordInputSettings &_new_settings) : MTPBoxed(MTPaccount_updatePasswordSettings(_current_password_hash, _new_settings)) { + } +}; + class MTPusers_getUsers { // RPC method 'users.getUsers' public: MTPVector vid; @@ -12835,6 +13752,87 @@ public: } }; +class MTPcontacts_search { // RPC method 'contacts.search' +public: + MTPstring vq; + MTPint vlimit; + + MTPcontacts_search() { + } + MTPcontacts_search(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_contacts_search) { + read(from, end, cons); + } + MTPcontacts_search(const MTPstring &_q, MTPint _limit) : vq(_q), vlimit(_limit) { + } + + uint32 innerLength() const { + return vq.innerLength() + vlimit.innerLength(); + } + mtpTypeId type() const { + return mtpc_contacts_search; + } + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_contacts_search) { + vq.read(from, end); + vlimit.read(from, end); + } + void write(mtpBuffer &to) const { + vq.write(to); + vlimit.write(to); + } + + typedef MTPcontacts_Found ResponseType; +}; +class MTPcontacts_Search : public MTPBoxed { +public: + MTPcontacts_Search() { + } + MTPcontacts_Search(const MTPcontacts_search &v) : MTPBoxed(v) { + } + MTPcontacts_Search(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { + } + MTPcontacts_Search(const MTPstring &_q, MTPint _limit) : MTPBoxed(MTPcontacts_search(_q, _limit)) { + } +}; + +class MTPcontacts_resolveUsername { // RPC method 'contacts.resolveUsername' +public: + MTPstring vusername; + + MTPcontacts_resolveUsername() { + } + MTPcontacts_resolveUsername(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_contacts_resolveUsername) { + read(from, end, cons); + } + MTPcontacts_resolveUsername(const MTPstring &_username) : vusername(_username) { + } + + uint32 innerLength() const { + return vusername.innerLength(); + } + mtpTypeId type() const { + return mtpc_contacts_resolveUsername; + } + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_contacts_resolveUsername) { + vusername.read(from, end); + } + void write(mtpBuffer &to) const { + vusername.write(to); + } + + typedef MTPUser ResponseType; +}; +class MTPcontacts_ResolveUsername : public MTPBoxed { +public: + MTPcontacts_ResolveUsername() { + } + MTPcontacts_ResolveUsername(const MTPcontacts_resolveUsername &v) : MTPBoxed(v) { + } + MTPcontacts_ResolveUsername(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { + } + MTPcontacts_ResolveUsername(const MTPstring &_username) : MTPBoxed(MTPcontacts_resolveUsername(_username)) { + } +}; + class MTPmessages_getMessages { // RPC method 'messages.getMessages' public: MTPVector vid; @@ -13699,537 +14697,6 @@ public: } }; -class MTPupdates_getState { // RPC method 'updates.getState' -public: - MTPupdates_getState() { - } - MTPupdates_getState(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_updates_getState) { - read(from, end, cons); - } - - uint32 innerLength() const { - return 0; - } - mtpTypeId type() const { - return mtpc_updates_getState; - } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_updates_getState) { - } - void write(mtpBuffer &to) const { - } - - typedef MTPupdates_State ResponseType; -}; -class MTPupdates_GetState : public MTPBoxed { -public: - MTPupdates_GetState() { - } - MTPupdates_GetState(const MTPupdates_getState &v) : MTPBoxed(v) { - } - MTPupdates_GetState(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { - } -}; - -class MTPupdates_getDifference { // RPC method 'updates.getDifference' -public: - MTPint vpts; - MTPint vdate; - MTPint vqts; - - MTPupdates_getDifference() { - } - MTPupdates_getDifference(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_updates_getDifference) { - read(from, end, cons); - } - MTPupdates_getDifference(MTPint _pts, MTPint _date, MTPint _qts) : vpts(_pts), vdate(_date), vqts(_qts) { - } - - uint32 innerLength() const { - return vpts.innerLength() + vdate.innerLength() + vqts.innerLength(); - } - mtpTypeId type() const { - return mtpc_updates_getDifference; - } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_updates_getDifference) { - vpts.read(from, end); - vdate.read(from, end); - vqts.read(from, end); - } - void write(mtpBuffer &to) const { - vpts.write(to); - vdate.write(to); - vqts.write(to); - } - - typedef MTPupdates_Difference ResponseType; -}; -class MTPupdates_GetDifference : public MTPBoxed { -public: - MTPupdates_GetDifference() { - } - MTPupdates_GetDifference(const MTPupdates_getDifference &v) : MTPBoxed(v) { - } - MTPupdates_GetDifference(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { - } - MTPupdates_GetDifference(MTPint _pts, MTPint _date, MTPint _qts) : MTPBoxed(MTPupdates_getDifference(_pts, _date, _qts)) { - } -}; - -class MTPphotos_updateProfilePhoto { // RPC method 'photos.updateProfilePhoto' -public: - MTPInputPhoto vid; - MTPInputPhotoCrop vcrop; - - MTPphotos_updateProfilePhoto() { - } - MTPphotos_updateProfilePhoto(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_photos_updateProfilePhoto) { - read(from, end, cons); - } - MTPphotos_updateProfilePhoto(const MTPInputPhoto &_id, const MTPInputPhotoCrop &_crop) : vid(_id), vcrop(_crop) { - } - - uint32 innerLength() const { - return vid.innerLength() + vcrop.innerLength(); - } - mtpTypeId type() const { - return mtpc_photos_updateProfilePhoto; - } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_photos_updateProfilePhoto) { - vid.read(from, end); - vcrop.read(from, end); - } - void write(mtpBuffer &to) const { - vid.write(to); - vcrop.write(to); - } - - typedef MTPUserProfilePhoto ResponseType; -}; -class MTPphotos_UpdateProfilePhoto : public MTPBoxed { -public: - MTPphotos_UpdateProfilePhoto() { - } - MTPphotos_UpdateProfilePhoto(const MTPphotos_updateProfilePhoto &v) : MTPBoxed(v) { - } - MTPphotos_UpdateProfilePhoto(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { - } - MTPphotos_UpdateProfilePhoto(const MTPInputPhoto &_id, const MTPInputPhotoCrop &_crop) : MTPBoxed(MTPphotos_updateProfilePhoto(_id, _crop)) { - } -}; - -class MTPphotos_uploadProfilePhoto { // RPC method 'photos.uploadProfilePhoto' -public: - MTPInputFile vfile; - MTPstring vcaption; - MTPInputGeoPoint vgeo_point; - MTPInputPhotoCrop vcrop; - - MTPphotos_uploadProfilePhoto() { - } - MTPphotos_uploadProfilePhoto(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_photos_uploadProfilePhoto) { - read(from, end, cons); - } - MTPphotos_uploadProfilePhoto(const MTPInputFile &_file, const MTPstring &_caption, const MTPInputGeoPoint &_geo_point, const MTPInputPhotoCrop &_crop) : vfile(_file), vcaption(_caption), vgeo_point(_geo_point), vcrop(_crop) { - } - - uint32 innerLength() const { - return vfile.innerLength() + vcaption.innerLength() + vgeo_point.innerLength() + vcrop.innerLength(); - } - mtpTypeId type() const { - return mtpc_photos_uploadProfilePhoto; - } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_photos_uploadProfilePhoto) { - vfile.read(from, end); - vcaption.read(from, end); - vgeo_point.read(from, end); - vcrop.read(from, end); - } - void write(mtpBuffer &to) const { - vfile.write(to); - vcaption.write(to); - vgeo_point.write(to); - vcrop.write(to); - } - - typedef MTPphotos_Photo ResponseType; -}; -class MTPphotos_UploadProfilePhoto : public MTPBoxed { -public: - MTPphotos_UploadProfilePhoto() { - } - MTPphotos_UploadProfilePhoto(const MTPphotos_uploadProfilePhoto &v) : MTPBoxed(v) { - } - MTPphotos_UploadProfilePhoto(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { - } - MTPphotos_UploadProfilePhoto(const MTPInputFile &_file, const MTPstring &_caption, const MTPInputGeoPoint &_geo_point, const MTPInputPhotoCrop &_crop) : MTPBoxed(MTPphotos_uploadProfilePhoto(_file, _caption, _geo_point, _crop)) { - } -}; - -class MTPphotos_deletePhotos { // RPC method 'photos.deletePhotos' -public: - MTPVector vid; - - MTPphotos_deletePhotos() { - } - MTPphotos_deletePhotos(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_photos_deletePhotos) { - read(from, end, cons); - } - MTPphotos_deletePhotos(const MTPVector &_id) : vid(_id) { - } - - uint32 innerLength() const { - return vid.innerLength(); - } - mtpTypeId type() const { - return mtpc_photos_deletePhotos; - } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_photos_deletePhotos) { - vid.read(from, end); - } - void write(mtpBuffer &to) const { - vid.write(to); - } - - typedef MTPVector ResponseType; -}; -class MTPphotos_DeletePhotos : public MTPBoxed { -public: - MTPphotos_DeletePhotos() { - } - MTPphotos_DeletePhotos(const MTPphotos_deletePhotos &v) : MTPBoxed(v) { - } - MTPphotos_DeletePhotos(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { - } - MTPphotos_DeletePhotos(const MTPVector &_id) : MTPBoxed(MTPphotos_deletePhotos(_id)) { - } -}; - -class MTPupload_saveFilePart { // RPC method 'upload.saveFilePart' -public: - MTPlong vfile_id; - MTPint vfile_part; - MTPbytes vbytes; - - MTPupload_saveFilePart() { - } - MTPupload_saveFilePart(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_upload_saveFilePart) { - read(from, end, cons); - } - MTPupload_saveFilePart(const MTPlong &_file_id, MTPint _file_part, const MTPbytes &_bytes) : vfile_id(_file_id), vfile_part(_file_part), vbytes(_bytes) { - } - - uint32 innerLength() const { - return vfile_id.innerLength() + vfile_part.innerLength() + vbytes.innerLength(); - } - mtpTypeId type() const { - return mtpc_upload_saveFilePart; - } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_upload_saveFilePart) { - vfile_id.read(from, end); - vfile_part.read(from, end); - vbytes.read(from, end); - } - void write(mtpBuffer &to) const { - vfile_id.write(to); - vfile_part.write(to); - vbytes.write(to); - } - - typedef MTPBool ResponseType; -}; -class MTPupload_SaveFilePart : public MTPBoxed { -public: - MTPupload_SaveFilePart() { - } - MTPupload_SaveFilePart(const MTPupload_saveFilePart &v) : MTPBoxed(v) { - } - MTPupload_SaveFilePart(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { - } - MTPupload_SaveFilePart(const MTPlong &_file_id, MTPint _file_part, const MTPbytes &_bytes) : MTPBoxed(MTPupload_saveFilePart(_file_id, _file_part, _bytes)) { - } -}; - -class MTPupload_getFile { // RPC method 'upload.getFile' -public: - MTPInputFileLocation vlocation; - MTPint voffset; - MTPint vlimit; - - MTPupload_getFile() { - } - MTPupload_getFile(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_upload_getFile) { - read(from, end, cons); - } - MTPupload_getFile(const MTPInputFileLocation &_location, MTPint _offset, MTPint _limit) : vlocation(_location), voffset(_offset), vlimit(_limit) { - } - - uint32 innerLength() const { - return vlocation.innerLength() + voffset.innerLength() + vlimit.innerLength(); - } - mtpTypeId type() const { - return mtpc_upload_getFile; - } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_upload_getFile) { - vlocation.read(from, end); - voffset.read(from, end); - vlimit.read(from, end); - } - void write(mtpBuffer &to) const { - vlocation.write(to); - voffset.write(to); - vlimit.write(to); - } - - typedef MTPupload_File ResponseType; -}; -class MTPupload_GetFile : public MTPBoxed { -public: - MTPupload_GetFile() { - } - MTPupload_GetFile(const MTPupload_getFile &v) : MTPBoxed(v) { - } - MTPupload_GetFile(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { - } - MTPupload_GetFile(const MTPInputFileLocation &_location, MTPint _offset, MTPint _limit) : MTPBoxed(MTPupload_getFile(_location, _offset, _limit)) { - } -}; - -class MTPhelp_getConfig { // RPC method 'help.getConfig' -public: - MTPhelp_getConfig() { - } - MTPhelp_getConfig(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_help_getConfig) { - read(from, end, cons); - } - - uint32 innerLength() const { - return 0; - } - mtpTypeId type() const { - return mtpc_help_getConfig; - } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_help_getConfig) { - } - void write(mtpBuffer &to) const { - } - - typedef MTPConfig ResponseType; -}; -class MTPhelp_GetConfig : public MTPBoxed { -public: - MTPhelp_GetConfig() { - } - MTPhelp_GetConfig(const MTPhelp_getConfig &v) : MTPBoxed(v) { - } - MTPhelp_GetConfig(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { - } -}; - -class MTPhelp_getNearestDc { // RPC method 'help.getNearestDc' -public: - MTPhelp_getNearestDc() { - } - MTPhelp_getNearestDc(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_help_getNearestDc) { - read(from, end, cons); - } - - uint32 innerLength() const { - return 0; - } - mtpTypeId type() const { - return mtpc_help_getNearestDc; - } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_help_getNearestDc) { - } - void write(mtpBuffer &to) const { - } - - typedef MTPNearestDc ResponseType; -}; -class MTPhelp_GetNearestDc : public MTPBoxed { -public: - MTPhelp_GetNearestDc() { - } - MTPhelp_GetNearestDc(const MTPhelp_getNearestDc &v) : MTPBoxed(v) { - } - MTPhelp_GetNearestDc(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { - } -}; - -class MTPhelp_getAppUpdate { // RPC method 'help.getAppUpdate' -public: - MTPstring vdevice_model; - MTPstring vsystem_version; - MTPstring vapp_version; - MTPstring vlang_code; - - MTPhelp_getAppUpdate() { - } - MTPhelp_getAppUpdate(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_help_getAppUpdate) { - read(from, end, cons); - } - MTPhelp_getAppUpdate(const MTPstring &_device_model, const MTPstring &_system_version, const MTPstring &_app_version, const MTPstring &_lang_code) : vdevice_model(_device_model), vsystem_version(_system_version), vapp_version(_app_version), vlang_code(_lang_code) { - } - - uint32 innerLength() const { - return vdevice_model.innerLength() + vsystem_version.innerLength() + vapp_version.innerLength() + vlang_code.innerLength(); - } - mtpTypeId type() const { - return mtpc_help_getAppUpdate; - } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_help_getAppUpdate) { - vdevice_model.read(from, end); - vsystem_version.read(from, end); - vapp_version.read(from, end); - vlang_code.read(from, end); - } - void write(mtpBuffer &to) const { - vdevice_model.write(to); - vsystem_version.write(to); - vapp_version.write(to); - vlang_code.write(to); - } - - typedef MTPhelp_AppUpdate ResponseType; -}; -class MTPhelp_GetAppUpdate : public MTPBoxed { -public: - MTPhelp_GetAppUpdate() { - } - MTPhelp_GetAppUpdate(const MTPhelp_getAppUpdate &v) : MTPBoxed(v) { - } - MTPhelp_GetAppUpdate(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { - } - MTPhelp_GetAppUpdate(const MTPstring &_device_model, const MTPstring &_system_version, const MTPstring &_app_version, const MTPstring &_lang_code) : MTPBoxed(MTPhelp_getAppUpdate(_device_model, _system_version, _app_version, _lang_code)) { - } -}; - -class MTPhelp_saveAppLog { // RPC method 'help.saveAppLog' -public: - MTPVector vevents; - - MTPhelp_saveAppLog() { - } - MTPhelp_saveAppLog(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_help_saveAppLog) { - read(from, end, cons); - } - MTPhelp_saveAppLog(const MTPVector &_events) : vevents(_events) { - } - - uint32 innerLength() const { - return vevents.innerLength(); - } - mtpTypeId type() const { - return mtpc_help_saveAppLog; - } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_help_saveAppLog) { - vevents.read(from, end); - } - void write(mtpBuffer &to) const { - vevents.write(to); - } - - typedef MTPBool ResponseType; -}; -class MTPhelp_SaveAppLog : public MTPBoxed { -public: - MTPhelp_SaveAppLog() { - } - MTPhelp_SaveAppLog(const MTPhelp_saveAppLog &v) : MTPBoxed(v) { - } - MTPhelp_SaveAppLog(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { - } - MTPhelp_SaveAppLog(const MTPVector &_events) : MTPBoxed(MTPhelp_saveAppLog(_events)) { - } -}; - -class MTPhelp_getInviteText { // RPC method 'help.getInviteText' -public: - MTPstring vlang_code; - - MTPhelp_getInviteText() { - } - MTPhelp_getInviteText(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_help_getInviteText) { - read(from, end, cons); - } - MTPhelp_getInviteText(const MTPstring &_lang_code) : vlang_code(_lang_code) { - } - - uint32 innerLength() const { - return vlang_code.innerLength(); - } - mtpTypeId type() const { - return mtpc_help_getInviteText; - } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_help_getInviteText) { - vlang_code.read(from, end); - } - void write(mtpBuffer &to) const { - vlang_code.write(to); - } - - typedef MTPhelp_InviteText ResponseType; -}; -class MTPhelp_GetInviteText : public MTPBoxed { -public: - MTPhelp_GetInviteText() { - } - MTPhelp_GetInviteText(const MTPhelp_getInviteText &v) : MTPBoxed(v) { - } - MTPhelp_GetInviteText(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { - } - MTPhelp_GetInviteText(const MTPstring &_lang_code) : MTPBoxed(MTPhelp_getInviteText(_lang_code)) { - } -}; - -class MTPphotos_getUserPhotos { // RPC method 'photos.getUserPhotos' -public: - MTPInputUser vuser_id; - MTPint voffset; - MTPlong vmax_id; - MTPint vlimit; - - MTPphotos_getUserPhotos() { - } - MTPphotos_getUserPhotos(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_photos_getUserPhotos) { - read(from, end, cons); - } - MTPphotos_getUserPhotos(const MTPInputUser &_user_id, MTPint _offset, const MTPlong &_max_id, MTPint _limit) : vuser_id(_user_id), voffset(_offset), vmax_id(_max_id), vlimit(_limit) { - } - - uint32 innerLength() const { - return vuser_id.innerLength() + voffset.innerLength() + vmax_id.innerLength() + vlimit.innerLength(); - } - mtpTypeId type() const { - return mtpc_photos_getUserPhotos; - } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_photos_getUserPhotos) { - vuser_id.read(from, end); - voffset.read(from, end); - vmax_id.read(from, end); - vlimit.read(from, end); - } - void write(mtpBuffer &to) const { - vuser_id.write(to); - voffset.write(to); - vmax_id.write(to); - vlimit.write(to); - } - - typedef MTPphotos_Photos ResponseType; -}; -class MTPphotos_GetUserPhotos : public MTPBoxed { -public: - MTPphotos_GetUserPhotos() { - } - MTPphotos_GetUserPhotos(const MTPphotos_getUserPhotos &v) : MTPBoxed(v) { - } - MTPphotos_GetUserPhotos(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { - } - MTPphotos_GetUserPhotos(const MTPInputUser &_user_id, MTPint _offset, const MTPlong &_max_id, MTPint _limit) : MTPBoxed(MTPphotos_getUserPhotos(_user_id, _offset, _max_id, _limit)) { - } -}; - class MTPmessages_forwardMessage { // RPC method 'messages.forwardMessage' public: MTPInputPeer vpeer; @@ -14755,181 +15222,6 @@ public: } }; -class MTPupload_saveBigFilePart { // RPC method 'upload.saveBigFilePart' -public: - MTPlong vfile_id; - MTPint vfile_part; - MTPint vfile_total_parts; - MTPbytes vbytes; - - MTPupload_saveBigFilePart() { - } - MTPupload_saveBigFilePart(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_upload_saveBigFilePart) { - read(from, end, cons); - } - MTPupload_saveBigFilePart(const MTPlong &_file_id, MTPint _file_part, MTPint _file_total_parts, const MTPbytes &_bytes) : vfile_id(_file_id), vfile_part(_file_part), vfile_total_parts(_file_total_parts), vbytes(_bytes) { - } - - uint32 innerLength() const { - return vfile_id.innerLength() + vfile_part.innerLength() + vfile_total_parts.innerLength() + vbytes.innerLength(); - } - mtpTypeId type() const { - return mtpc_upload_saveBigFilePart; - } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_upload_saveBigFilePart) { - vfile_id.read(from, end); - vfile_part.read(from, end); - vfile_total_parts.read(from, end); - vbytes.read(from, end); - } - void write(mtpBuffer &to) const { - vfile_id.write(to); - vfile_part.write(to); - vfile_total_parts.write(to); - vbytes.write(to); - } - - typedef MTPBool ResponseType; -}; -class MTPupload_SaveBigFilePart : public MTPBoxed { -public: - MTPupload_SaveBigFilePart() { - } - MTPupload_SaveBigFilePart(const MTPupload_saveBigFilePart &v) : MTPBoxed(v) { - } - MTPupload_SaveBigFilePart(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { - } - MTPupload_SaveBigFilePart(const MTPlong &_file_id, MTPint _file_part, MTPint _file_total_parts, const MTPbytes &_bytes) : MTPBoxed(MTPupload_saveBigFilePart(_file_id, _file_part, _file_total_parts, _bytes)) { - } -}; - -template -class MTPinitConnection { // RPC method 'initConnection' -public: - MTPint vapi_id; - MTPstring vdevice_model; - MTPstring vsystem_version; - MTPstring vapp_version; - MTPstring vlang_code; - TQueryType vquery; - - MTPinitConnection() { - } - MTPinitConnection(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_initConnection) { - read(from, end, cons); - } - MTPinitConnection(MTPint _api_id, const MTPstring &_device_model, const MTPstring &_system_version, const MTPstring &_app_version, const MTPstring &_lang_code, const TQueryType &_query) : vapi_id(_api_id), vdevice_model(_device_model), vsystem_version(_system_version), vapp_version(_app_version), vlang_code(_lang_code), vquery(_query) { - } - - uint32 innerLength() const { - return vapi_id.innerLength() + vdevice_model.innerLength() + vsystem_version.innerLength() + vapp_version.innerLength() + vlang_code.innerLength() + vquery.innerLength(); - } - mtpTypeId type() const { - return mtpc_initConnection; - } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_initConnection) { - vapi_id.read(from, end); - vdevice_model.read(from, end); - vsystem_version.read(from, end); - vapp_version.read(from, end); - vlang_code.read(from, end); - vquery.read(from, end); - } - void write(mtpBuffer &to) const { - vapi_id.write(to); - vdevice_model.write(to); - vsystem_version.write(to); - vapp_version.write(to); - vlang_code.write(to); - vquery.write(to); - } - - typedef typename TQueryType::ResponseType ResponseType; -}; -template -class MTPInitConnection : public MTPBoxed > { -public: - MTPInitConnection() { - } - MTPInitConnection(const MTPinitConnection &v) : MTPBoxed >(v) { - } - MTPInitConnection(MTPint _api_id, const MTPstring &_device_model, const MTPstring &_system_version, const MTPstring &_app_version, const MTPstring &_lang_code, const TQueryType &_query) : MTPBoxed >(MTPinitConnection(_api_id, _device_model, _system_version, _app_version, _lang_code, _query)) { - } -}; - -class MTPhelp_getSupport { // RPC method 'help.getSupport' -public: - MTPhelp_getSupport() { - } - MTPhelp_getSupport(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_help_getSupport) { - read(from, end, cons); - } - - uint32 innerLength() const { - return 0; - } - mtpTypeId type() const { - return mtpc_help_getSupport; - } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_help_getSupport) { - } - void write(mtpBuffer &to) const { - } - - typedef MTPhelp_Support ResponseType; -}; -class MTPhelp_GetSupport : public MTPBoxed { -public: - MTPhelp_GetSupport() { - } - MTPhelp_GetSupport(const MTPhelp_getSupport &v) : MTPBoxed(v) { - } - MTPhelp_GetSupport(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { - } -}; - -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 MTPmessages_readMessageContents { // RPC method 'messages.readMessageContents' public: MTPVector vid; @@ -14969,481 +15261,6 @@ public: } }; -class MTPaccount_checkUsername { // RPC method 'account.checkUsername' -public: - MTPstring vusername; - - MTPaccount_checkUsername() { - } - MTPaccount_checkUsername(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_account_checkUsername) { - read(from, end, cons); - } - MTPaccount_checkUsername(const MTPstring &_username) : vusername(_username) { - } - - uint32 innerLength() const { - return vusername.innerLength(); - } - mtpTypeId type() const { - return mtpc_account_checkUsername; - } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_account_checkUsername) { - vusername.read(from, end); - } - void write(mtpBuffer &to) const { - vusername.write(to); - } - - typedef MTPBool ResponseType; -}; -class MTPaccount_CheckUsername : public MTPBoxed { -public: - MTPaccount_CheckUsername() { - } - MTPaccount_CheckUsername(const MTPaccount_checkUsername &v) : MTPBoxed(v) { - } - MTPaccount_CheckUsername(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { - } - MTPaccount_CheckUsername(const MTPstring &_username) : MTPBoxed(MTPaccount_checkUsername(_username)) { - } -}; - -class MTPaccount_updateUsername { // RPC method 'account.updateUsername' -public: - MTPstring vusername; - - MTPaccount_updateUsername() { - } - MTPaccount_updateUsername(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_account_updateUsername) { - read(from, end, cons); - } - MTPaccount_updateUsername(const MTPstring &_username) : vusername(_username) { - } - - uint32 innerLength() const { - return vusername.innerLength(); - } - mtpTypeId type() const { - return mtpc_account_updateUsername; - } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_account_updateUsername) { - vusername.read(from, end); - } - void write(mtpBuffer &to) const { - vusername.write(to); - } - - typedef MTPUser ResponseType; -}; -class MTPaccount_UpdateUsername : public MTPBoxed { -public: - MTPaccount_UpdateUsername() { - } - MTPaccount_UpdateUsername(const MTPaccount_updateUsername &v) : MTPBoxed(v) { - } - MTPaccount_UpdateUsername(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { - } - MTPaccount_UpdateUsername(const MTPstring &_username) : MTPBoxed(MTPaccount_updateUsername(_username)) { - } -}; - -class MTPcontacts_search { // RPC method 'contacts.search' -public: - MTPstring vq; - MTPint vlimit; - - MTPcontacts_search() { - } - MTPcontacts_search(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_contacts_search) { - read(from, end, cons); - } - MTPcontacts_search(const MTPstring &_q, MTPint _limit) : vq(_q), vlimit(_limit) { - } - - uint32 innerLength() const { - return vq.innerLength() + vlimit.innerLength(); - } - mtpTypeId type() const { - return mtpc_contacts_search; - } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_contacts_search) { - vq.read(from, end); - vlimit.read(from, end); - } - void write(mtpBuffer &to) const { - vq.write(to); - vlimit.write(to); - } - - typedef MTPcontacts_Found ResponseType; -}; -class MTPcontacts_Search : public MTPBoxed { -public: - MTPcontacts_Search() { - } - MTPcontacts_Search(const MTPcontacts_search &v) : MTPBoxed(v) { - } - MTPcontacts_Search(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { - } - MTPcontacts_Search(const MTPstring &_q, MTPint _limit) : MTPBoxed(MTPcontacts_search(_q, _limit)) { - } -}; - -class MTPaccount_getPrivacy { // RPC method 'account.getPrivacy' -public: - MTPInputPrivacyKey vkey; - - MTPaccount_getPrivacy() { - } - MTPaccount_getPrivacy(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_account_getPrivacy) { - read(from, end, cons); - } - MTPaccount_getPrivacy(const MTPInputPrivacyKey &_key) : vkey(_key) { - } - - uint32 innerLength() const { - return vkey.innerLength(); - } - mtpTypeId type() const { - return mtpc_account_getPrivacy; - } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_account_getPrivacy) { - vkey.read(from, end); - } - void write(mtpBuffer &to) const { - vkey.write(to); - } - - typedef MTPaccount_PrivacyRules ResponseType; -}; -class MTPaccount_GetPrivacy : public MTPBoxed { -public: - MTPaccount_GetPrivacy() { - } - MTPaccount_GetPrivacy(const MTPaccount_getPrivacy &v) : MTPBoxed(v) { - } - MTPaccount_GetPrivacy(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { - } - MTPaccount_GetPrivacy(const MTPInputPrivacyKey &_key) : MTPBoxed(MTPaccount_getPrivacy(_key)) { - } -}; - -class MTPaccount_setPrivacy { // RPC method 'account.setPrivacy' -public: - MTPInputPrivacyKey vkey; - MTPVector vrules; - - MTPaccount_setPrivacy() { - } - MTPaccount_setPrivacy(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_account_setPrivacy) { - read(from, end, cons); - } - MTPaccount_setPrivacy(const MTPInputPrivacyKey &_key, const MTPVector &_rules) : vkey(_key), vrules(_rules) { - } - - uint32 innerLength() const { - return vkey.innerLength() + vrules.innerLength(); - } - mtpTypeId type() const { - return mtpc_account_setPrivacy; - } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_account_setPrivacy) { - vkey.read(from, end); - vrules.read(from, end); - } - void write(mtpBuffer &to) const { - vkey.write(to); - vrules.write(to); - } - - typedef MTPaccount_PrivacyRules ResponseType; -}; -class MTPaccount_SetPrivacy : public MTPBoxed { -public: - MTPaccount_SetPrivacy() { - } - MTPaccount_SetPrivacy(const MTPaccount_setPrivacy &v) : MTPBoxed(v) { - } - MTPaccount_SetPrivacy(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { - } - MTPaccount_SetPrivacy(const MTPInputPrivacyKey &_key, const MTPVector &_rules) : MTPBoxed(MTPaccount_setPrivacy(_key, _rules)) { - } -}; - -class MTPaccount_deleteAccount { // RPC method 'account.deleteAccount' -public: - MTPstring vreason; - - MTPaccount_deleteAccount() { - } - MTPaccount_deleteAccount(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_account_deleteAccount) { - read(from, end, cons); - } - MTPaccount_deleteAccount(const MTPstring &_reason) : vreason(_reason) { - } - - uint32 innerLength() const { - return vreason.innerLength(); - } - mtpTypeId type() const { - return mtpc_account_deleteAccount; - } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_account_deleteAccount) { - vreason.read(from, end); - } - void write(mtpBuffer &to) const { - vreason.write(to); - } - - typedef MTPBool ResponseType; -}; -class MTPaccount_DeleteAccount : public MTPBoxed { -public: - MTPaccount_DeleteAccount() { - } - MTPaccount_DeleteAccount(const MTPaccount_deleteAccount &v) : MTPBoxed(v) { - } - MTPaccount_DeleteAccount(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { - } - MTPaccount_DeleteAccount(const MTPstring &_reason) : MTPBoxed(MTPaccount_deleteAccount(_reason)) { - } -}; - -class MTPaccount_getAccountTTL { // RPC method 'account.getAccountTTL' -public: - MTPaccount_getAccountTTL() { - } - MTPaccount_getAccountTTL(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_account_getAccountTTL) { - read(from, end, cons); - } - - uint32 innerLength() const { - return 0; - } - mtpTypeId type() const { - return mtpc_account_getAccountTTL; - } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_account_getAccountTTL) { - } - void write(mtpBuffer &to) const { - } - - typedef MTPAccountDaysTTL ResponseType; -}; -class MTPaccount_GetAccountTTL : public MTPBoxed { -public: - MTPaccount_GetAccountTTL() { - } - MTPaccount_GetAccountTTL(const MTPaccount_getAccountTTL &v) : MTPBoxed(v) { - } - MTPaccount_GetAccountTTL(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { - } -}; - -class MTPaccount_setAccountTTL { // RPC method 'account.setAccountTTL' -public: - MTPAccountDaysTTL vttl; - - MTPaccount_setAccountTTL() { - } - MTPaccount_setAccountTTL(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_account_setAccountTTL) { - read(from, end, cons); - } - MTPaccount_setAccountTTL(const MTPAccountDaysTTL &_ttl) : vttl(_ttl) { - } - - uint32 innerLength() const { - return vttl.innerLength(); - } - mtpTypeId type() const { - return mtpc_account_setAccountTTL; - } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_account_setAccountTTL) { - vttl.read(from, end); - } - void write(mtpBuffer &to) const { - vttl.write(to); - } - - typedef MTPBool ResponseType; -}; -class MTPaccount_SetAccountTTL : public MTPBoxed { -public: - MTPaccount_SetAccountTTL() { - } - MTPaccount_SetAccountTTL(const MTPaccount_setAccountTTL &v) : MTPBoxed(v) { - } - MTPaccount_SetAccountTTL(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { - } - MTPaccount_SetAccountTTL(const MTPAccountDaysTTL &_ttl) : MTPBoxed(MTPaccount_setAccountTTL(_ttl)) { - } -}; - -template -class MTPinvokeWithLayer { // RPC method 'invokeWithLayer' -public: - MTPint vlayer; - TQueryType vquery; - - MTPinvokeWithLayer() { - } - MTPinvokeWithLayer(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_invokeWithLayer) { - read(from, end, cons); - } - MTPinvokeWithLayer(MTPint _layer, const TQueryType &_query) : vlayer(_layer), vquery(_query) { - } - - uint32 innerLength() const { - return vlayer.innerLength() + vquery.innerLength(); - } - mtpTypeId type() const { - return mtpc_invokeWithLayer; - } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_invokeWithLayer) { - vlayer.read(from, end); - vquery.read(from, end); - } - void write(mtpBuffer &to) const { - vlayer.write(to); - vquery.write(to); - } - - typedef typename TQueryType::ResponseType ResponseType; -}; -template -class MTPInvokeWithLayer : public MTPBoxed > { -public: - MTPInvokeWithLayer() { - } - MTPInvokeWithLayer(const MTPinvokeWithLayer &v) : MTPBoxed >(v) { - } - MTPInvokeWithLayer(MTPint _layer, const TQueryType &_query) : MTPBoxed >(MTPinvokeWithLayer(_layer, _query)) { - } -}; - -class MTPcontacts_resolveUsername { // RPC method 'contacts.resolveUsername' -public: - MTPstring vusername; - - MTPcontacts_resolveUsername() { - } - MTPcontacts_resolveUsername(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_contacts_resolveUsername) { - read(from, end, cons); - } - MTPcontacts_resolveUsername(const MTPstring &_username) : vusername(_username) { - } - - uint32 innerLength() const { - return vusername.innerLength(); - } - mtpTypeId type() const { - return mtpc_contacts_resolveUsername; - } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_contacts_resolveUsername) { - vusername.read(from, end); - } - void write(mtpBuffer &to) const { - vusername.write(to); - } - - typedef MTPUser ResponseType; -}; -class MTPcontacts_ResolveUsername : public MTPBoxed { -public: - MTPcontacts_ResolveUsername() { - } - MTPcontacts_ResolveUsername(const MTPcontacts_resolveUsername &v) : MTPBoxed(v) { - } - MTPcontacts_ResolveUsername(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { - } - MTPcontacts_ResolveUsername(const MTPstring &_username) : MTPBoxed(MTPcontacts_resolveUsername(_username)) { - } -}; - -class MTPaccount_sendChangePhoneCode { // RPC method 'account.sendChangePhoneCode' -public: - MTPstring vphone_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) { - } - - uint32 innerLength() const { - return vphone_number.innerLength(); - } - mtpTypeId type() const { - return mtpc_account_sendChangePhoneCode; - } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_account_sendChangePhoneCode) { - vphone_number.read(from, end); - } - void write(mtpBuffer &to) const { - vphone_number.write(to); - } - - typedef MTPaccount_SentChangePhoneCode ResponseType; -}; -class MTPaccount_SendChangePhoneCode : public MTPBoxed { -public: - MTPaccount_SendChangePhoneCode() { - } - MTPaccount_SendChangePhoneCode(const MTPaccount_sendChangePhoneCode &v) : MTPBoxed(v) { - } - 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)) { - } -}; - -class MTPaccount_changePhone { // RPC method 'account.changePhone' -public: - MTPstring vphone_number; - MTPstring vphone_code_hash; - MTPstring vphone_code; - - MTPaccount_changePhone() { - } - MTPaccount_changePhone(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_account_changePhone) { - read(from, end, cons); - } - MTPaccount_changePhone(const MTPstring &_phone_number, const MTPstring &_phone_code_hash, const MTPstring &_phone_code) : vphone_number(_phone_number), vphone_code_hash(_phone_code_hash), vphone_code(_phone_code) { - } - - uint32 innerLength() const { - return vphone_number.innerLength() + vphone_code_hash.innerLength() + vphone_code.innerLength(); - } - mtpTypeId type() const { - return mtpc_account_changePhone; - } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_account_changePhone) { - vphone_number.read(from, end); - vphone_code_hash.read(from, end); - vphone_code.read(from, end); - } - void write(mtpBuffer &to) const { - vphone_number.write(to); - vphone_code_hash.write(to); - vphone_code.write(to); - } - - typedef MTPUser ResponseType; -}; -class MTPaccount_ChangePhone : public MTPBoxed { -public: - MTPaccount_ChangePhone() { - } - MTPaccount_ChangePhone(const MTPaccount_changePhone &v) : MTPBoxed(v) { - } - MTPaccount_ChangePhone(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { - } - MTPaccount_ChangePhone(const MTPstring &_phone_number, const MTPstring &_phone_code_hash, const MTPstring &_phone_code) : MTPBoxed(MTPaccount_changePhone(_phone_number, _phone_code_hash, _phone_code)) { - } -}; - class MTPmessages_getStickers { // RPC method 'messages.getStickers' public: MTPstring vemoticon; @@ -15525,93 +15342,6 @@ public: } }; -class MTPaccount_updateDeviceLocked { // RPC method 'account.updateDeviceLocked' -public: - MTPint vperiod; - - MTPaccount_updateDeviceLocked() { - } - MTPaccount_updateDeviceLocked(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_account_updateDeviceLocked) { - read(from, end, cons); - } - MTPaccount_updateDeviceLocked(MTPint _period) : vperiod(_period) { - } - - uint32 innerLength() const { - return vperiod.innerLength(); - } - mtpTypeId type() const { - return mtpc_account_updateDeviceLocked; - } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_account_updateDeviceLocked) { - vperiod.read(from, end); - } - void write(mtpBuffer &to) const { - vperiod.write(to); - } - - typedef MTPBool ResponseType; -}; -class MTPaccount_UpdateDeviceLocked : public MTPBoxed { -public: - MTPaccount_UpdateDeviceLocked() { - } - MTPaccount_UpdateDeviceLocked(const MTPaccount_updateDeviceLocked &v) : MTPBoxed(v) { - } - MTPaccount_UpdateDeviceLocked(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { - } - MTPaccount_UpdateDeviceLocked(MTPint _period) : MTPBoxed(MTPaccount_updateDeviceLocked(_period)) { - } -}; - -class MTPauth_importBotAuthorization { // RPC method 'auth.importBotAuthorization' -public: - MTPint vflags; - MTPint vapi_id; - MTPstring vapi_hash; - MTPstring vbot_auth_token; - - MTPauth_importBotAuthorization() { - } - MTPauth_importBotAuthorization(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_auth_importBotAuthorization) { - read(from, end, cons); - } - MTPauth_importBotAuthorization(MTPint _flags, MTPint _api_id, const MTPstring &_api_hash, const MTPstring &_bot_auth_token) : vflags(_flags), vapi_id(_api_id), vapi_hash(_api_hash), vbot_auth_token(_bot_auth_token) { - } - - uint32 innerLength() const { - return vflags.innerLength() + vapi_id.innerLength() + vapi_hash.innerLength() + vbot_auth_token.innerLength(); - } - mtpTypeId type() const { - return mtpc_auth_importBotAuthorization; - } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_auth_importBotAuthorization) { - vflags.read(from, end); - vapi_id.read(from, end); - vapi_hash.read(from, end); - vbot_auth_token.read(from, end); - } - void write(mtpBuffer &to) const { - vflags.write(to); - vapi_id.write(to); - vapi_hash.write(to); - vbot_auth_token.write(to); - } - - typedef MTPauth_Authorization ResponseType; -}; -class MTPauth_ImportBotAuthorization : public MTPBoxed { -public: - MTPauth_ImportBotAuthorization() { - } - MTPauth_ImportBotAuthorization(const MTPauth_importBotAuthorization &v) : MTPBoxed(v) { - } - MTPauth_ImportBotAuthorization(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { - } - MTPauth_ImportBotAuthorization(MTPint _flags, MTPint _api_id, const MTPstring &_api_hash, const MTPstring &_bot_auth_token) : MTPBoxed(MTPauth_importBotAuthorization(_flags, _api_id, _api_hash, _bot_auth_token)) { - } -}; - class MTPmessages_getWebPagePreview { // RPC method 'messages.getWebPagePreview' public: MTPstring vmessage; @@ -15651,336 +15381,6 @@ public: } }; -class MTPaccount_getAuthorizations { // RPC method 'account.getAuthorizations' -public: - MTPaccount_getAuthorizations() { - } - MTPaccount_getAuthorizations(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_account_getAuthorizations) { - read(from, end, cons); - } - - uint32 innerLength() const { - return 0; - } - mtpTypeId type() const { - return mtpc_account_getAuthorizations; - } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_account_getAuthorizations) { - } - void write(mtpBuffer &to) const { - } - - typedef MTPaccount_Authorizations ResponseType; -}; -class MTPaccount_GetAuthorizations : public MTPBoxed { -public: - MTPaccount_GetAuthorizations() { - } - MTPaccount_GetAuthorizations(const MTPaccount_getAuthorizations &v) : MTPBoxed(v) { - } - MTPaccount_GetAuthorizations(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { - } -}; - -class MTPaccount_resetAuthorization { // RPC method 'account.resetAuthorization' -public: - MTPlong vhash; - - MTPaccount_resetAuthorization() { - } - MTPaccount_resetAuthorization(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_account_resetAuthorization) { - read(from, end, cons); - } - MTPaccount_resetAuthorization(const MTPlong &_hash) : vhash(_hash) { - } - - uint32 innerLength() const { - return vhash.innerLength(); - } - mtpTypeId type() const { - return mtpc_account_resetAuthorization; - } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_account_resetAuthorization) { - vhash.read(from, end); - } - void write(mtpBuffer &to) const { - vhash.write(to); - } - - typedef MTPBool ResponseType; -}; -class MTPaccount_ResetAuthorization : public MTPBoxed { -public: - MTPaccount_ResetAuthorization() { - } - MTPaccount_ResetAuthorization(const MTPaccount_resetAuthorization &v) : MTPBoxed(v) { - } - MTPaccount_ResetAuthorization(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { - } - MTPaccount_ResetAuthorization(const MTPlong &_hash) : MTPBoxed(MTPaccount_resetAuthorization(_hash)) { - } -}; - -class MTPaccount_getPassword { // RPC method 'account.getPassword' -public: - MTPaccount_getPassword() { - } - MTPaccount_getPassword(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_account_getPassword) { - read(from, end, cons); - } - - uint32 innerLength() const { - return 0; - } - mtpTypeId type() const { - return mtpc_account_getPassword; - } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_account_getPassword) { - } - void write(mtpBuffer &to) const { - } - - typedef MTPaccount_Password ResponseType; -}; -class MTPaccount_GetPassword : public MTPBoxed { -public: - MTPaccount_GetPassword() { - } - MTPaccount_GetPassword(const MTPaccount_getPassword &v) : MTPBoxed(v) { - } - MTPaccount_GetPassword(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { - } -}; - -class MTPaccount_getPasswordSettings { // RPC method 'account.getPasswordSettings' -public: - MTPbytes vcurrent_password_hash; - - MTPaccount_getPasswordSettings() { - } - MTPaccount_getPasswordSettings(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_account_getPasswordSettings) { - read(from, end, cons); - } - MTPaccount_getPasswordSettings(const MTPbytes &_current_password_hash) : vcurrent_password_hash(_current_password_hash) { - } - - uint32 innerLength() const { - return vcurrent_password_hash.innerLength(); - } - mtpTypeId type() const { - return mtpc_account_getPasswordSettings; - } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_account_getPasswordSettings) { - vcurrent_password_hash.read(from, end); - } - void write(mtpBuffer &to) const { - vcurrent_password_hash.write(to); - } - - typedef MTPaccount_PasswordSettings ResponseType; -}; -class MTPaccount_GetPasswordSettings : public MTPBoxed { -public: - MTPaccount_GetPasswordSettings() { - } - MTPaccount_GetPasswordSettings(const MTPaccount_getPasswordSettings &v) : MTPBoxed(v) { - } - MTPaccount_GetPasswordSettings(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { - } - MTPaccount_GetPasswordSettings(const MTPbytes &_current_password_hash) : MTPBoxed(MTPaccount_getPasswordSettings(_current_password_hash)) { - } -}; - -class MTPaccount_updatePasswordSettings { // RPC method 'account.updatePasswordSettings' -public: - MTPbytes vcurrent_password_hash; - MTPaccount_PasswordInputSettings vnew_settings; - - MTPaccount_updatePasswordSettings() { - } - MTPaccount_updatePasswordSettings(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_account_updatePasswordSettings) { - read(from, end, cons); - } - MTPaccount_updatePasswordSettings(const MTPbytes &_current_password_hash, const MTPaccount_PasswordInputSettings &_new_settings) : vcurrent_password_hash(_current_password_hash), vnew_settings(_new_settings) { - } - - uint32 innerLength() const { - return vcurrent_password_hash.innerLength() + vnew_settings.innerLength(); - } - mtpTypeId type() const { - return mtpc_account_updatePasswordSettings; - } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_account_updatePasswordSettings) { - vcurrent_password_hash.read(from, end); - vnew_settings.read(from, end); - } - void write(mtpBuffer &to) const { - vcurrent_password_hash.write(to); - vnew_settings.write(to); - } - - typedef MTPBool ResponseType; -}; -class MTPaccount_UpdatePasswordSettings : public MTPBoxed { -public: - MTPaccount_UpdatePasswordSettings() { - } - MTPaccount_UpdatePasswordSettings(const MTPaccount_updatePasswordSettings &v) : MTPBoxed(v) { - } - MTPaccount_UpdatePasswordSettings(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { - } - MTPaccount_UpdatePasswordSettings(const MTPbytes &_current_password_hash, const MTPaccount_PasswordInputSettings &_new_settings) : MTPBoxed(MTPaccount_updatePasswordSettings(_current_password_hash, _new_settings)) { - } -}; - -class MTPauth_checkPassword { // RPC method 'auth.checkPassword' -public: - MTPbytes vpassword_hash; - - MTPauth_checkPassword() { - } - MTPauth_checkPassword(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_auth_checkPassword) { - read(from, end, cons); - } - MTPauth_checkPassword(const MTPbytes &_password_hash) : vpassword_hash(_password_hash) { - } - - uint32 innerLength() const { - return vpassword_hash.innerLength(); - } - mtpTypeId type() const { - return mtpc_auth_checkPassword; - } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_auth_checkPassword) { - vpassword_hash.read(from, end); - } - void write(mtpBuffer &to) const { - vpassword_hash.write(to); - } - - typedef MTPauth_Authorization ResponseType; -}; -class MTPauth_CheckPassword : public MTPBoxed { -public: - MTPauth_CheckPassword() { - } - MTPauth_CheckPassword(const MTPauth_checkPassword &v) : MTPBoxed(v) { - } - MTPauth_CheckPassword(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { - } - MTPauth_CheckPassword(const MTPbytes &_password_hash) : MTPBoxed(MTPauth_checkPassword(_password_hash)) { - } -}; - -class MTPauth_requestPasswordRecovery { // RPC method 'auth.requestPasswordRecovery' -public: - MTPauth_requestPasswordRecovery() { - } - MTPauth_requestPasswordRecovery(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_auth_requestPasswordRecovery) { - read(from, end, cons); - } - - uint32 innerLength() const { - return 0; - } - mtpTypeId type() const { - return mtpc_auth_requestPasswordRecovery; - } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_auth_requestPasswordRecovery) { - } - void write(mtpBuffer &to) const { - } - - typedef MTPauth_PasswordRecovery ResponseType; -}; -class MTPauth_RequestPasswordRecovery : public MTPBoxed { -public: - MTPauth_RequestPasswordRecovery() { - } - MTPauth_RequestPasswordRecovery(const MTPauth_requestPasswordRecovery &v) : MTPBoxed(v) { - } - MTPauth_RequestPasswordRecovery(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { - } -}; - -class MTPauth_recoverPassword { // RPC method 'auth.recoverPassword' -public: - MTPstring vcode; - - MTPauth_recoverPassword() { - } - MTPauth_recoverPassword(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_auth_recoverPassword) { - read(from, end, cons); - } - MTPauth_recoverPassword(const MTPstring &_code) : vcode(_code) { - } - - uint32 innerLength() const { - return vcode.innerLength(); - } - mtpTypeId type() const { - return mtpc_auth_recoverPassword; - } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_auth_recoverPassword) { - vcode.read(from, end); - } - void write(mtpBuffer &to) const { - vcode.write(to); - } - - typedef MTPauth_Authorization ResponseType; -}; -class MTPauth_RecoverPassword : public MTPBoxed { -public: - MTPauth_RecoverPassword() { - } - MTPauth_RecoverPassword(const MTPauth_recoverPassword &v) : MTPBoxed(v) { - } - MTPauth_RecoverPassword(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { - } - MTPauth_RecoverPassword(const MTPstring &_code) : MTPBoxed(MTPauth_recoverPassword(_code)) { - } -}; - -template -class MTPinvokeWithoutUpdates { // RPC method 'invokeWithoutUpdates' -public: - TQueryType vquery; - - MTPinvokeWithoutUpdates() { - } - MTPinvokeWithoutUpdates(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_invokeWithoutUpdates) { - read(from, end, cons); - } - MTPinvokeWithoutUpdates(const TQueryType &_query) : vquery(_query) { - } - - uint32 innerLength() const { - return vquery.innerLength(); - } - mtpTypeId type() const { - return mtpc_invokeWithoutUpdates; - } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_invokeWithoutUpdates) { - vquery.read(from, end); - } - void write(mtpBuffer &to) const { - vquery.write(to); - } - - typedef typename TQueryType::ResponseType ResponseType; -}; -template -class MTPInvokeWithoutUpdates : public MTPBoxed > { -public: - MTPInvokeWithoutUpdates() { - } - MTPInvokeWithoutUpdates(const MTPinvokeWithoutUpdates &v) : MTPBoxed >(v) { - } - MTPInvokeWithoutUpdates(const TQueryType &_query) : MTPBoxed >(MTPinvokeWithoutUpdates(_query)) { - } -}; - class MTPmessages_exportChatInvite { // RPC method 'messages.exportChatInvite' public: MTPint vchat_id; @@ -16266,6 +15666,655 @@ public: } }; +class MTPmessages_reportSpam { // RPC method 'messages.reportSpam' +public: + MTPInputPeer vpeer; + + MTPmessages_reportSpam() { + } + MTPmessages_reportSpam(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_messages_reportSpam) { + read(from, end, cons); + } + MTPmessages_reportSpam(const MTPInputPeer &_peer) : vpeer(_peer) { + } + + uint32 innerLength() const { + return vpeer.innerLength(); + } + mtpTypeId type() const { + return mtpc_messages_reportSpam; + } + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_messages_reportSpam) { + vpeer.read(from, end); + } + void write(mtpBuffer &to) const { + vpeer.write(to); + } + + typedef MTPBool ResponseType; +}; +class MTPmessages_ReportSpam : public MTPBoxed { +public: + MTPmessages_ReportSpam() { + } + MTPmessages_ReportSpam(const MTPmessages_reportSpam &v) : MTPBoxed(v) { + } + MTPmessages_ReportSpam(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { + } + MTPmessages_ReportSpam(const MTPInputPeer &_peer) : MTPBoxed(MTPmessages_reportSpam(_peer)) { + } +}; + +class MTPupdates_getState { // RPC method 'updates.getState' +public: + MTPupdates_getState() { + } + MTPupdates_getState(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_updates_getState) { + read(from, end, cons); + } + + uint32 innerLength() const { + return 0; + } + mtpTypeId type() const { + return mtpc_updates_getState; + } + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_updates_getState) { + } + void write(mtpBuffer &to) const { + } + + typedef MTPupdates_State ResponseType; +}; +class MTPupdates_GetState : public MTPBoxed { +public: + MTPupdates_GetState() { + } + MTPupdates_GetState(const MTPupdates_getState &v) : MTPBoxed(v) { + } + MTPupdates_GetState(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { + } +}; + +class MTPupdates_getDifference { // RPC method 'updates.getDifference' +public: + MTPint vpts; + MTPint vdate; + MTPint vqts; + + MTPupdates_getDifference() { + } + MTPupdates_getDifference(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_updates_getDifference) { + read(from, end, cons); + } + MTPupdates_getDifference(MTPint _pts, MTPint _date, MTPint _qts) : vpts(_pts), vdate(_date), vqts(_qts) { + } + + uint32 innerLength() const { + return vpts.innerLength() + vdate.innerLength() + vqts.innerLength(); + } + mtpTypeId type() const { + return mtpc_updates_getDifference; + } + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_updates_getDifference) { + vpts.read(from, end); + vdate.read(from, end); + vqts.read(from, end); + } + void write(mtpBuffer &to) const { + vpts.write(to); + vdate.write(to); + vqts.write(to); + } + + typedef MTPupdates_Difference ResponseType; +}; +class MTPupdates_GetDifference : public MTPBoxed { +public: + MTPupdates_GetDifference() { + } + MTPupdates_GetDifference(const MTPupdates_getDifference &v) : MTPBoxed(v) { + } + MTPupdates_GetDifference(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { + } + MTPupdates_GetDifference(MTPint _pts, MTPint _date, MTPint _qts) : MTPBoxed(MTPupdates_getDifference(_pts, _date, _qts)) { + } +}; + +class MTPphotos_updateProfilePhoto { // RPC method 'photos.updateProfilePhoto' +public: + MTPInputPhoto vid; + MTPInputPhotoCrop vcrop; + + MTPphotos_updateProfilePhoto() { + } + MTPphotos_updateProfilePhoto(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_photos_updateProfilePhoto) { + read(from, end, cons); + } + MTPphotos_updateProfilePhoto(const MTPInputPhoto &_id, const MTPInputPhotoCrop &_crop) : vid(_id), vcrop(_crop) { + } + + uint32 innerLength() const { + return vid.innerLength() + vcrop.innerLength(); + } + mtpTypeId type() const { + return mtpc_photos_updateProfilePhoto; + } + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_photos_updateProfilePhoto) { + vid.read(from, end); + vcrop.read(from, end); + } + void write(mtpBuffer &to) const { + vid.write(to); + vcrop.write(to); + } + + typedef MTPUserProfilePhoto ResponseType; +}; +class MTPphotos_UpdateProfilePhoto : public MTPBoxed { +public: + MTPphotos_UpdateProfilePhoto() { + } + MTPphotos_UpdateProfilePhoto(const MTPphotos_updateProfilePhoto &v) : MTPBoxed(v) { + } + MTPphotos_UpdateProfilePhoto(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { + } + MTPphotos_UpdateProfilePhoto(const MTPInputPhoto &_id, const MTPInputPhotoCrop &_crop) : MTPBoxed(MTPphotos_updateProfilePhoto(_id, _crop)) { + } +}; + +class MTPphotos_uploadProfilePhoto { // RPC method 'photos.uploadProfilePhoto' +public: + MTPInputFile vfile; + MTPstring vcaption; + MTPInputGeoPoint vgeo_point; + MTPInputPhotoCrop vcrop; + + MTPphotos_uploadProfilePhoto() { + } + MTPphotos_uploadProfilePhoto(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_photos_uploadProfilePhoto) { + read(from, end, cons); + } + MTPphotos_uploadProfilePhoto(const MTPInputFile &_file, const MTPstring &_caption, const MTPInputGeoPoint &_geo_point, const MTPInputPhotoCrop &_crop) : vfile(_file), vcaption(_caption), vgeo_point(_geo_point), vcrop(_crop) { + } + + uint32 innerLength() const { + return vfile.innerLength() + vcaption.innerLength() + vgeo_point.innerLength() + vcrop.innerLength(); + } + mtpTypeId type() const { + return mtpc_photos_uploadProfilePhoto; + } + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_photos_uploadProfilePhoto) { + vfile.read(from, end); + vcaption.read(from, end); + vgeo_point.read(from, end); + vcrop.read(from, end); + } + void write(mtpBuffer &to) const { + vfile.write(to); + vcaption.write(to); + vgeo_point.write(to); + vcrop.write(to); + } + + typedef MTPphotos_Photo ResponseType; +}; +class MTPphotos_UploadProfilePhoto : public MTPBoxed { +public: + MTPphotos_UploadProfilePhoto() { + } + MTPphotos_UploadProfilePhoto(const MTPphotos_uploadProfilePhoto &v) : MTPBoxed(v) { + } + MTPphotos_UploadProfilePhoto(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { + } + MTPphotos_UploadProfilePhoto(const MTPInputFile &_file, const MTPstring &_caption, const MTPInputGeoPoint &_geo_point, const MTPInputPhotoCrop &_crop) : MTPBoxed(MTPphotos_uploadProfilePhoto(_file, _caption, _geo_point, _crop)) { + } +}; + +class MTPphotos_deletePhotos { // RPC method 'photos.deletePhotos' +public: + MTPVector vid; + + MTPphotos_deletePhotos() { + } + MTPphotos_deletePhotos(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_photos_deletePhotos) { + read(from, end, cons); + } + MTPphotos_deletePhotos(const MTPVector &_id) : vid(_id) { + } + + uint32 innerLength() const { + return vid.innerLength(); + } + mtpTypeId type() const { + return mtpc_photos_deletePhotos; + } + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_photos_deletePhotos) { + vid.read(from, end); + } + void write(mtpBuffer &to) const { + vid.write(to); + } + + typedef MTPVector ResponseType; +}; +class MTPphotos_DeletePhotos : public MTPBoxed { +public: + MTPphotos_DeletePhotos() { + } + MTPphotos_DeletePhotos(const MTPphotos_deletePhotos &v) : MTPBoxed(v) { + } + MTPphotos_DeletePhotos(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { + } + MTPphotos_DeletePhotos(const MTPVector &_id) : MTPBoxed(MTPphotos_deletePhotos(_id)) { + } +}; + +class MTPphotos_getUserPhotos { // RPC method 'photos.getUserPhotos' +public: + MTPInputUser vuser_id; + MTPint voffset; + MTPlong vmax_id; + MTPint vlimit; + + MTPphotos_getUserPhotos() { + } + MTPphotos_getUserPhotos(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_photos_getUserPhotos) { + read(from, end, cons); + } + MTPphotos_getUserPhotos(const MTPInputUser &_user_id, MTPint _offset, const MTPlong &_max_id, MTPint _limit) : vuser_id(_user_id), voffset(_offset), vmax_id(_max_id), vlimit(_limit) { + } + + uint32 innerLength() const { + return vuser_id.innerLength() + voffset.innerLength() + vmax_id.innerLength() + vlimit.innerLength(); + } + mtpTypeId type() const { + return mtpc_photos_getUserPhotos; + } + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_photos_getUserPhotos) { + vuser_id.read(from, end); + voffset.read(from, end); + vmax_id.read(from, end); + vlimit.read(from, end); + } + void write(mtpBuffer &to) const { + vuser_id.write(to); + voffset.write(to); + vmax_id.write(to); + vlimit.write(to); + } + + typedef MTPphotos_Photos ResponseType; +}; +class MTPphotos_GetUserPhotos : public MTPBoxed { +public: + MTPphotos_GetUserPhotos() { + } + MTPphotos_GetUserPhotos(const MTPphotos_getUserPhotos &v) : MTPBoxed(v) { + } + MTPphotos_GetUserPhotos(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { + } + MTPphotos_GetUserPhotos(const MTPInputUser &_user_id, MTPint _offset, const MTPlong &_max_id, MTPint _limit) : MTPBoxed(MTPphotos_getUserPhotos(_user_id, _offset, _max_id, _limit)) { + } +}; + +class MTPupload_saveFilePart { // RPC method 'upload.saveFilePart' +public: + MTPlong vfile_id; + MTPint vfile_part; + MTPbytes vbytes; + + MTPupload_saveFilePart() { + } + MTPupload_saveFilePart(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_upload_saveFilePart) { + read(from, end, cons); + } + MTPupload_saveFilePart(const MTPlong &_file_id, MTPint _file_part, const MTPbytes &_bytes) : vfile_id(_file_id), vfile_part(_file_part), vbytes(_bytes) { + } + + uint32 innerLength() const { + return vfile_id.innerLength() + vfile_part.innerLength() + vbytes.innerLength(); + } + mtpTypeId type() const { + return mtpc_upload_saveFilePart; + } + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_upload_saveFilePart) { + vfile_id.read(from, end); + vfile_part.read(from, end); + vbytes.read(from, end); + } + void write(mtpBuffer &to) const { + vfile_id.write(to); + vfile_part.write(to); + vbytes.write(to); + } + + typedef MTPBool ResponseType; +}; +class MTPupload_SaveFilePart : public MTPBoxed { +public: + MTPupload_SaveFilePart() { + } + MTPupload_SaveFilePart(const MTPupload_saveFilePart &v) : MTPBoxed(v) { + } + MTPupload_SaveFilePart(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { + } + MTPupload_SaveFilePart(const MTPlong &_file_id, MTPint _file_part, const MTPbytes &_bytes) : MTPBoxed(MTPupload_saveFilePart(_file_id, _file_part, _bytes)) { + } +}; + +class MTPupload_getFile { // RPC method 'upload.getFile' +public: + MTPInputFileLocation vlocation; + MTPint voffset; + MTPint vlimit; + + MTPupload_getFile() { + } + MTPupload_getFile(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_upload_getFile) { + read(from, end, cons); + } + MTPupload_getFile(const MTPInputFileLocation &_location, MTPint _offset, MTPint _limit) : vlocation(_location), voffset(_offset), vlimit(_limit) { + } + + uint32 innerLength() const { + return vlocation.innerLength() + voffset.innerLength() + vlimit.innerLength(); + } + mtpTypeId type() const { + return mtpc_upload_getFile; + } + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_upload_getFile) { + vlocation.read(from, end); + voffset.read(from, end); + vlimit.read(from, end); + } + void write(mtpBuffer &to) const { + vlocation.write(to); + voffset.write(to); + vlimit.write(to); + } + + typedef MTPupload_File ResponseType; +}; +class MTPupload_GetFile : public MTPBoxed { +public: + MTPupload_GetFile() { + } + MTPupload_GetFile(const MTPupload_getFile &v) : MTPBoxed(v) { + } + MTPupload_GetFile(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { + } + MTPupload_GetFile(const MTPInputFileLocation &_location, MTPint _offset, MTPint _limit) : MTPBoxed(MTPupload_getFile(_location, _offset, _limit)) { + } +}; + +class MTPupload_saveBigFilePart { // RPC method 'upload.saveBigFilePart' +public: + MTPlong vfile_id; + MTPint vfile_part; + MTPint vfile_total_parts; + MTPbytes vbytes; + + MTPupload_saveBigFilePart() { + } + MTPupload_saveBigFilePart(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_upload_saveBigFilePart) { + read(from, end, cons); + } + MTPupload_saveBigFilePart(const MTPlong &_file_id, MTPint _file_part, MTPint _file_total_parts, const MTPbytes &_bytes) : vfile_id(_file_id), vfile_part(_file_part), vfile_total_parts(_file_total_parts), vbytes(_bytes) { + } + + uint32 innerLength() const { + return vfile_id.innerLength() + vfile_part.innerLength() + vfile_total_parts.innerLength() + vbytes.innerLength(); + } + mtpTypeId type() const { + return mtpc_upload_saveBigFilePart; + } + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_upload_saveBigFilePart) { + vfile_id.read(from, end); + vfile_part.read(from, end); + vfile_total_parts.read(from, end); + vbytes.read(from, end); + } + void write(mtpBuffer &to) const { + vfile_id.write(to); + vfile_part.write(to); + vfile_total_parts.write(to); + vbytes.write(to); + } + + typedef MTPBool ResponseType; +}; +class MTPupload_SaveBigFilePart : public MTPBoxed { +public: + MTPupload_SaveBigFilePart() { + } + MTPupload_SaveBigFilePart(const MTPupload_saveBigFilePart &v) : MTPBoxed(v) { + } + MTPupload_SaveBigFilePart(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { + } + MTPupload_SaveBigFilePart(const MTPlong &_file_id, MTPint _file_part, MTPint _file_total_parts, const MTPbytes &_bytes) : MTPBoxed(MTPupload_saveBigFilePart(_file_id, _file_part, _file_total_parts, _bytes)) { + } +}; + +class MTPhelp_getConfig { // RPC method 'help.getConfig' +public: + MTPhelp_getConfig() { + } + MTPhelp_getConfig(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_help_getConfig) { + read(from, end, cons); + } + + uint32 innerLength() const { + return 0; + } + mtpTypeId type() const { + return mtpc_help_getConfig; + } + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_help_getConfig) { + } + void write(mtpBuffer &to) const { + } + + typedef MTPConfig ResponseType; +}; +class MTPhelp_GetConfig : public MTPBoxed { +public: + MTPhelp_GetConfig() { + } + MTPhelp_GetConfig(const MTPhelp_getConfig &v) : MTPBoxed(v) { + } + MTPhelp_GetConfig(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { + } +}; + +class MTPhelp_getNearestDc { // RPC method 'help.getNearestDc' +public: + MTPhelp_getNearestDc() { + } + MTPhelp_getNearestDc(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_help_getNearestDc) { + read(from, end, cons); + } + + uint32 innerLength() const { + return 0; + } + mtpTypeId type() const { + return mtpc_help_getNearestDc; + } + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_help_getNearestDc) { + } + void write(mtpBuffer &to) const { + } + + typedef MTPNearestDc ResponseType; +}; +class MTPhelp_GetNearestDc : public MTPBoxed { +public: + MTPhelp_GetNearestDc() { + } + MTPhelp_GetNearestDc(const MTPhelp_getNearestDc &v) : MTPBoxed(v) { + } + MTPhelp_GetNearestDc(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { + } +}; + +class MTPhelp_getAppUpdate { // RPC method 'help.getAppUpdate' +public: + MTPstring vdevice_model; + MTPstring vsystem_version; + MTPstring vapp_version; + MTPstring vlang_code; + + MTPhelp_getAppUpdate() { + } + MTPhelp_getAppUpdate(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_help_getAppUpdate) { + read(from, end, cons); + } + MTPhelp_getAppUpdate(const MTPstring &_device_model, const MTPstring &_system_version, const MTPstring &_app_version, const MTPstring &_lang_code) : vdevice_model(_device_model), vsystem_version(_system_version), vapp_version(_app_version), vlang_code(_lang_code) { + } + + uint32 innerLength() const { + return vdevice_model.innerLength() + vsystem_version.innerLength() + vapp_version.innerLength() + vlang_code.innerLength(); + } + mtpTypeId type() const { + return mtpc_help_getAppUpdate; + } + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_help_getAppUpdate) { + vdevice_model.read(from, end); + vsystem_version.read(from, end); + vapp_version.read(from, end); + vlang_code.read(from, end); + } + void write(mtpBuffer &to) const { + vdevice_model.write(to); + vsystem_version.write(to); + vapp_version.write(to); + vlang_code.write(to); + } + + typedef MTPhelp_AppUpdate ResponseType; +}; +class MTPhelp_GetAppUpdate : public MTPBoxed { +public: + MTPhelp_GetAppUpdate() { + } + MTPhelp_GetAppUpdate(const MTPhelp_getAppUpdate &v) : MTPBoxed(v) { + } + MTPhelp_GetAppUpdate(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { + } + MTPhelp_GetAppUpdate(const MTPstring &_device_model, const MTPstring &_system_version, const MTPstring &_app_version, const MTPstring &_lang_code) : MTPBoxed(MTPhelp_getAppUpdate(_device_model, _system_version, _app_version, _lang_code)) { + } +}; + +class MTPhelp_saveAppLog { // RPC method 'help.saveAppLog' +public: + MTPVector vevents; + + MTPhelp_saveAppLog() { + } + MTPhelp_saveAppLog(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_help_saveAppLog) { + read(from, end, cons); + } + MTPhelp_saveAppLog(const MTPVector &_events) : vevents(_events) { + } + + uint32 innerLength() const { + return vevents.innerLength(); + } + mtpTypeId type() const { + return mtpc_help_saveAppLog; + } + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_help_saveAppLog) { + vevents.read(from, end); + } + void write(mtpBuffer &to) const { + vevents.write(to); + } + + typedef MTPBool ResponseType; +}; +class MTPhelp_SaveAppLog : public MTPBoxed { +public: + MTPhelp_SaveAppLog() { + } + MTPhelp_SaveAppLog(const MTPhelp_saveAppLog &v) : MTPBoxed(v) { + } + MTPhelp_SaveAppLog(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { + } + MTPhelp_SaveAppLog(const MTPVector &_events) : MTPBoxed(MTPhelp_saveAppLog(_events)) { + } +}; + +class MTPhelp_getInviteText { // RPC method 'help.getInviteText' +public: + MTPstring vlang_code; + + MTPhelp_getInviteText() { + } + MTPhelp_getInviteText(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_help_getInviteText) { + read(from, end, cons); + } + MTPhelp_getInviteText(const MTPstring &_lang_code) : vlang_code(_lang_code) { + } + + uint32 innerLength() const { + return vlang_code.innerLength(); + } + mtpTypeId type() const { + return mtpc_help_getInviteText; + } + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_help_getInviteText) { + vlang_code.read(from, end); + } + void write(mtpBuffer &to) const { + vlang_code.write(to); + } + + typedef MTPhelp_InviteText ResponseType; +}; +class MTPhelp_GetInviteText : public MTPBoxed { +public: + MTPhelp_GetInviteText() { + } + MTPhelp_GetInviteText(const MTPhelp_getInviteText &v) : MTPBoxed(v) { + } + MTPhelp_GetInviteText(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { + } + MTPhelp_GetInviteText(const MTPstring &_lang_code) : MTPBoxed(MTPhelp_getInviteText(_lang_code)) { + } +}; + +class MTPhelp_getSupport { // RPC method 'help.getSupport' +public: + MTPhelp_getSupport() { + } + MTPhelp_getSupport(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_help_getSupport) { + read(from, end, cons); + } + + uint32 innerLength() const { + return 0; + } + mtpTypeId type() const { + return mtpc_help_getSupport; + } + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_help_getSupport) { + } + void write(mtpBuffer &to) const { + } + + typedef MTPhelp_Support ResponseType; +}; +class MTPhelp_GetSupport : public MTPBoxed { +public: + MTPhelp_GetSupport() { + } + MTPhelp_GetSupport(const MTPhelp_getSupport &v) : MTPBoxed(v) { + } + MTPhelp_GetSupport(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { + } +}; + class MTPhelp_getAppChangelog { // RPC method 'help.getAppChangelog' public: MTPstring vdevice_model; @@ -18858,7 +18907,7 @@ inline uint32 MTPchatParticipants::innerLength() const { switch (_type) { case mtpc_chatParticipantsForbidden: { const MTPDchatParticipantsForbidden &v(c_chatParticipantsForbidden()); - return v.vchat_id.innerLength(); + return v.vflags.innerLength() + v.vchat_id.innerLength() + (v.has_self_participant() ? v.vself_participant.innerLength() : 0); } case mtpc_chatParticipants: { const MTPDchatParticipants &v(c_chatParticipants()); @@ -18877,7 +18926,9 @@ inline void MTPchatParticipants::read(const mtpPrime *&from, const mtpPrime *end case mtpc_chatParticipantsForbidden: _type = cons; { if (!data) setData(new MTPDchatParticipantsForbidden()); MTPDchatParticipantsForbidden &v(_chatParticipantsForbidden()); + v.vflags.read(from, end); v.vchat_id.read(from, end); + if (v.has_self_participant()) { v.vself_participant.read(from, end); } else { v.vself_participant = MTPChatParticipant(); } } break; case mtpc_chatParticipants: _type = cons; { if (!data) setData(new MTPDchatParticipants()); @@ -18894,7 +18945,9 @@ inline void MTPchatParticipants::write(mtpBuffer &to) const { switch (_type) { case mtpc_chatParticipantsForbidden: { const MTPDchatParticipantsForbidden &v(c_chatParticipantsForbidden()); + v.vflags.write(to); v.vchat_id.write(to); + if (v.has_self_participant()) v.vself_participant.write(to); } break; case mtpc_chatParticipants: { const MTPDchatParticipants &v(c_chatParticipants()); @@ -18916,8 +18969,8 @@ inline MTPchatParticipants::MTPchatParticipants(MTPDchatParticipantsForbidden *_ } inline MTPchatParticipants::MTPchatParticipants(MTPDchatParticipants *_data) : mtpDataOwner(_data), _type(mtpc_chatParticipants) { } -inline MTPchatParticipants MTP_chatParticipantsForbidden(MTPint _chat_id) { - return MTPchatParticipants(new MTPDchatParticipantsForbidden(_chat_id)); +inline MTPchatParticipants MTP_chatParticipantsForbidden(MTPint _flags, MTPint _chat_id, const MTPChatParticipant &_self_participant) { + return MTPchatParticipants(new MTPDchatParticipantsForbidden(_flags, _chat_id, _self_participant)); } inline MTPchatParticipants MTP_chatParticipants(MTPint _chat_id, MTPint _admin_id, const MTPVector &_participants, MTPint _version) { return MTPchatParticipants(new MTPDchatParticipants(_chat_id, _admin_id, _participants, _version)); @@ -20989,7 +21042,7 @@ inline uint32 MTPupdate::innerLength() const { } case mtpc_updateChatParticipantAdd: { const MTPDupdateChatParticipantAdd &v(c_updateChatParticipantAdd()); - return v.vchat_id.innerLength() + v.vuser_id.innerLength() + v.vinviter_id.innerLength() + v.vversion.innerLength(); + return v.vchat_id.innerLength() + v.vuser_id.innerLength() + v.vinviter_id.innerLength() + v.vdate.innerLength() + v.vversion.innerLength(); } case mtpc_updateChatParticipantDelete: { const MTPDupdateChatParticipantDelete &v(c_updateChatParticipantDelete()); @@ -21156,6 +21209,7 @@ inline void MTPupdate::read(const mtpPrime *&from, const mtpPrime *end, mtpTypeI v.vchat_id.read(from, end); v.vuser_id.read(from, end); v.vinviter_id.read(from, end); + v.vdate.read(from, end); v.vversion.read(from, end); } break; case mtpc_updateChatParticipantDelete: _type = cons; { @@ -21329,6 +21383,7 @@ inline void MTPupdate::write(mtpBuffer &to) const { v.vchat_id.write(to); v.vuser_id.write(to); v.vinviter_id.write(to); + v.vdate.write(to); v.vversion.write(to); } break; case mtpc_updateChatParticipantDelete: { @@ -21531,8 +21586,8 @@ inline MTPupdate MTP_updateEncryption(const MTPEncryptedChat &_chat, MTPint _dat inline MTPupdate MTP_updateEncryptedMessagesRead(MTPint _chat_id, MTPint _max_date, MTPint _date) { return MTPupdate(new MTPDupdateEncryptedMessagesRead(_chat_id, _max_date, _date)); } -inline MTPupdate MTP_updateChatParticipantAdd(MTPint _chat_id, MTPint _user_id, MTPint _inviter_id, MTPint _version) { - return MTPupdate(new MTPDupdateChatParticipantAdd(_chat_id, _user_id, _inviter_id, _version)); +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)); } inline MTPupdate MTP_updateChatParticipantDelete(MTPint _chat_id, MTPint _user_id, MTPint _version) { return MTPupdate(new MTPDupdateChatParticipantDelete(_chat_id, _user_id, _version)); diff --git a/Telegram/SourceFiles/mtproto/scheme.tl b/Telegram/SourceFiles/mtproto/scheme.tl index 66803e904..33fb1f125 100644 --- a/Telegram/SourceFiles/mtproto/scheme.tl +++ b/Telegram/SourceFiles/mtproto/scheme.tl @@ -133,13 +133,16 @@ null#56730bcc = Null; inputPeerEmpty#7f3b18ea = InputPeer; inputPeerSelf#7da07ec9 = InputPeer; inputPeerChat#179be863 chat_id:int = InputPeer; +inputPeerUser#7b8e7de6 user_id:int access_hash:long = InputPeer; inputUserEmpty#b98886cf = InputUser; inputUserSelf#f7c1b13f = InputUser; +inputUser#d8292816 user_id:int access_hash:long = InputUser; inputPhoneContact#f392b7f4 client_id:long phone:string first_name:string last_name:string = InputContact; inputFile#f52ff27f id:long parts:int name:string md5_checksum:string = InputFile; +inputFileBig#fa4f0bb5 id:long parts:int name:string = InputFile; inputMediaEmpty#9664f57f = InputMedia; inputMediaUploadedPhoto#f7aff1c0 file:InputFile caption:string = InputMedia; @@ -149,6 +152,12 @@ 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#ffe76b78 file:InputFile mime_type:string attributes:Vector = InputMedia; +inputMediaUploadedThumbDocument#41481486 file:InputFile thumb:InputFile mime_type:string attributes:Vector = InputMedia; +inputMediaDocument#d184e841 id:InputDocument = InputMedia; +inputMediaVenue#2827a81a geo_point:InputGeoPoint title:string address:string provider:string venue_id:string = InputMedia; inputChatPhotoEmpty#1ca48f57 = InputChatPhoto; inputChatUploadedPhoto#94254732 file:InputFile crop:InputPhotoCrop = InputChatPhoto; @@ -165,6 +174,9 @@ 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; inputPhotoCrop#d9915325 crop_left:double crop_top:double crop_width:double = InputPhotoCrop; @@ -189,6 +201,7 @@ fileLocationUnavailable#7c596b46 volume_id:long local_id:int secret:long = FileL fileLocation#53d69076 dc_id:int volume_id:long local_id:int secret:long = FileLocation; userEmpty#200250ba id:int = User; +user#22e49072 flags:# id:int access_hash:flags.0?long first_name:flags.1?string last_name:flags.2?string username:flags.3?string phone:flags.4?string photo:flags.5?UserProfilePhoto status:flags.6?UserStatus bot_info_version:flags.14?int = User; userProfilePhotoEmpty#4f11bae1 = UserProfilePhoto; userProfilePhoto#d559d8c8 photo_id:long photo_small:FileLocation photo_big:FileLocation = UserProfilePhoto; @@ -196,6 +209,9 @@ userProfilePhoto#d559d8c8 photo_id:long photo_small:FileLocation photo_big:FileL userStatusEmpty#9d05049 = UserStatus; userStatusOnline#edb93949 expires:int = UserStatus; userStatusOffline#8c703f was_online:int = UserStatus; +userStatusRecently#e26f42f1 = UserStatus; +userStatusLastWeek#7bf09fc = UserStatus; +userStatusLastMonth#77ebc742 = UserStatus; chatEmpty#9ba2d800 id:int = Chat; chat#6e9c9bc7 id:int title:string photo:ChatPhoto participants_count:int date:int left:Bool version:int = Chat; @@ -205,7 +221,7 @@ chatFull#2e02a614 id:int participants:ChatParticipants chat_photo:Photo notify_s chatParticipant#c8d7493e user_id:int inviter_id:int date:int = ChatParticipant; -chatParticipantsForbidden#fd2bb8a chat_id:int = ChatParticipants; +chatParticipantsForbidden#fc900c2b flags:# chat_id:int self_participant:flags.0?ChatParticipant = ChatParticipants; chatParticipants#7841b415 chat_id:int admin_id:int participants:Vector version:int = ChatParticipants; chatPhotoEmpty#37c1011c = ChatPhoto; @@ -221,6 +237,10 @@ 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; +messageMediaDocument#2fda2204 document:Document = 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; messageActionEmpty#b6aef7b0 = MessageAction; messageActionChatCreate#a6638b9a title:string users:Vector = MessageAction; @@ -229,6 +249,7 @@ messageActionChatEditPhoto#7fcb13a8 photo:Photo = MessageAction; messageActionChatDeletePhoto#95e3fbef = MessageAction; messageActionChatAddUser#5e3cfc4b user_id:int = MessageAction; messageActionChatDeleteUser#b2ae9b0c user_id:int = MessageAction; +messageActionChatJoinedByLink#f89cf5e8 inviter_id:int = MessageAction; dialog#c1dd804a peer:Peer top_message:int read_inbox_max_id:int unread_count:int notify_settings:PeerNotifySettings = Dialog; @@ -248,6 +269,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.authorization#ff036af1 user:User = auth.Authorization; @@ -270,6 +292,7 @@ peerNotifySettingsEmpty#70a68512 = PeerNotifySettings; peerNotifySettings#8d5e11ee mute_until:int sound:string show_previews:Bool events_mask:int = PeerNotifySettings; wallPaper#ccb03657 id:int title:string sizes:Vector color:int = WallPaper; +wallPaperSolid#63117f24 id:int title:string bg_color:int color:int = WallPaper; userFull#5a89ac5b user:User link:contacts.Link profile_photo:Photo notify_settings:PeerNotifySettings blocked:Bool bot_info:BotInfo = UserFull; @@ -329,6 +352,22 @@ updateUserPhoto#95313b0c user_id:int date:int photo:UserProfilePhoto previous:Bo updateContactRegistered#2575bbb9 user_id:int date:int = Update; updateContactLink#9d2e67c5 user_id:int my_link:ContactLink foreign_link:ContactLink = Update; updateNewAuthorization#8f06529a auth_key_id:long date:int device:string location:string = Update; +updateNewEncryptedMessage#12bcbd9a message:EncryptedMessage qts:int = Update; +updateEncryptedChatTyping#1710f156 chat_id:int = Update; +updateEncryption#b4a2e88d chat:EncryptedChat date:int = Update; +updateEncryptedMessagesRead#38fe25b7 chat_id:int max_date:int date:int = Update; +updateChatParticipantAdd#ea4b0e5c chat_id:int user_id:int inviter_id:int date:int version:int = Update; +updateChatParticipantDelete#6e5f8c22 chat_id:int user_id:int version:int = Update; +updateDcOptions#8e5e9873 dc_options:Vector = Update; +updateUserBlocked#80ece81a user_id:int blocked:Bool = Update; +updateNotifySettings#bec268ef peer:NotifyPeer notify_settings:PeerNotifySettings = Update; +updateServiceNotification#382dd3e4 type:string message:string media:MessageMedia popup:Bool = Update; +updatePrivacy#ee3b272a key:PrivacyKey rules:Vector = Update; +updateUserPhone#12b9417b user_id:int phone:string = Update; +updateReadHistoryInbox#9961fd5c peer:Peer max_id:int pts:int pts_count:int = Update; +updateReadHistoryOutbox#2f2f21bf peer:Peer max_id:int pts:int pts_count:int = Update; +updateWebPage#2cc36971 webpage:WebPage = Update; +updateReadMessagesContents#68c13933 messages:Vector pts:int pts_count:int = Update; updates.state#a56c2a3e pts:int qts:int date:int seq:int unread_count:int = updates.State; @@ -342,6 +381,7 @@ updateShortChatMessage#f9409b3d flags:# id:int from_id:int chat_id:int message:s 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; +updateShortSentMessage#11f1331c flags:# id:int pts:int pts_count:int date:int media:flags.9?MessageMedia entities:flags.7?Vector = Updates; photos.photos#8dca6aa5 photos:Vector users:Vector = photos.Photos; photos.photosSlice#15051f54 count:int photos:Vector users:Vector = photos.Photos; @@ -361,13 +401,6 @@ help.noAppUpdate#c45a6536 = help.AppUpdate; help.inviteText#18cb9f78 message:string = help.InviteText; -wallPaperSolid#63117f24 id:int title:string bg_color:int color:int = WallPaper; - -updateNewEncryptedMessage#12bcbd9a message:EncryptedMessage qts:int = Update; -updateEncryptedChatTyping#1710f156 chat_id:int = Update; -updateEncryption#b4a2e88d chat:EncryptedChat date:int = Update; -updateEncryptedMessagesRead#38fe25b7 chat_id:int max_date:int date:int = Update; - encryptedChatEmpty#ab7ec0a0 id:int = EncryptedChat; encryptedChatWaiting#3bf703dc id:int access_hash:long date:int admin_id:int participant_id:int = EncryptedChat; encryptedChatRequested#c878527e id:int access_hash:long date:int admin_id:int participant_id:int g_a:bytes = EncryptedChat; @@ -382,8 +415,7 @@ encryptedFile#4a70994c id:long access_hash:long size:int dc_id:int key_fingerpri inputEncryptedFileEmpty#1837c364 = InputEncryptedFile; inputEncryptedFileUploaded#64bd0306 id:long parts:int md5_checksum:string key_fingerprint:int = InputEncryptedFile; inputEncryptedFile#5a17b5e5 id:long access_hash:long = InputEncryptedFile; - -inputEncryptedFileLocation#f5235d55 id:long access_hash:long = InputFileLocation; +inputEncryptedFileBigUploaded#2dc173c8 id:long parts:int key_fingerprint:int = InputEncryptedFile; encryptedMessage#ed18c118 random_id:long chat_id:int date:int bytes:bytes file:EncryptedFile = EncryptedMessage; encryptedMessageService#23734b06 random_id:long chat_id:int date:int bytes:bytes = EncryptedMessage; @@ -394,32 +426,12 @@ 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; -inputFileBig#fa4f0bb5 id:long parts:int name:string = InputFile; - -inputEncryptedFileBigUploaded#2dc173c8 id:long parts:int key_fingerprint:int = InputEncryptedFile; - -updateChatParticipantAdd#3a0eeb22 chat_id:int user_id:int inviter_id:int version:int = Update; -updateChatParticipantDelete#6e5f8c22 chat_id:int user_id:int version:int = Update; -updateDcOptions#8e5e9873 dc_options:Vector = Update; - -inputMediaUploadedAudio#4e498cab file:InputFile duration:int mime_type:string = InputMedia; -inputMediaAudio#89938781 id:InputAudio = InputMedia; -inputMediaUploadedDocument#ffe76b78 file:InputFile mime_type:string attributes:Vector = InputMedia; -inputMediaUploadedThumbDocument#41481486 file:InputFile thumb:InputFile mime_type:string attributes:Vector = InputMedia; -inputMediaDocument#d184e841 id:InputDocument = InputMedia; - -messageMediaDocument#2fda2204 document:Document = MessageMedia; -messageMediaAudio#c6b68300 audio:Audio = MessageMedia; - inputAudioEmpty#d95adc84 = InputAudio; inputAudio#77d440ff id:long access_hash:long = InputAudio; inputDocumentEmpty#72f0eaae = InputDocument; inputDocument#18798952 id:long access_hash:long = InputDocument; -inputAudioFileLocation#74dc404d id:long access_hash:long = InputFileLocation; -inputDocumentFileLocation#4e45abe9 id:long access_hash:long = InputFileLocation; - 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; @@ -433,11 +445,6 @@ notifyUsers#b4c83b4c = NotifyPeer; notifyChats#c007cec3 = NotifyPeer; notifyAll#74d07c60 = NotifyPeer; -updateUserBlocked#80ece81a user_id:int blocked:Bool = Update; -updateNotifySettings#bec268ef peer:NotifyPeer notify_settings:PeerNotifySettings = Update; - -auth.sentAppCode#e325edcf phone_registered:Bool phone_code_hash:string send_call_timeout:int is_password:Bool = auth.SentCode; - sendMessageTypingAction#16bf744e = SendMessageAction; sendMessageCancelAction#fd5ec8f5 = SendMessageAction; sendMessageRecordVideoAction#a187d66f = SendMessageAction; @@ -453,14 +460,6 @@ contactFound#ea879f95 user_id:int = ContactFound; contacts.found#566000e results:Vector users:Vector = contacts.Found; -updateServiceNotification#382dd3e4 type:string message:string media:MessageMedia popup:Bool = Update; - -userStatusRecently#e26f42f1 = UserStatus; -userStatusLastWeek#7bf09fc = UserStatus; -userStatusLastMonth#77ebc742 = UserStatus; - -updatePrivacy#ee3b272a key:PrivacyKey rules:Vector = Update; - inputPrivacyKeyStatusTimestamp#4f96cb18 = InputPrivacyKey; privacyKeyStatusTimestamp#bc2eab30 = PrivacyKey; @@ -485,8 +484,6 @@ accountDaysTTL#b8d0afdf days:int = AccountDaysTTL; account.sentChangePhoneCode#a4f58c4c phone_code_hash:string send_call_timeout:int = account.SentChangePhoneCode; -updateUserPhone#12b9417b user_id:int phone:string = Update; - documentAttributeImageSize#6c37c15c w:int h:int = DocumentAttribute; documentAttributeAnimated#11b58939 = DocumentAttribute; documentAttributeSticker#3a556302 alt:string stickerset:InputStickerSet = DocumentAttribute; @@ -504,9 +501,6 @@ messages.allStickers#d51dafdb hash:string sets:Vector = messages.All disabledFeature#ae636f24 feature:string description:string = DisabledFeature; -updateReadHistoryInbox#9961fd5c peer:Peer max_id:int pts:int pts_count:int = Update; -updateReadHistoryOutbox#2f2f21bf peer:Peer max_id:int pts:int pts_count:int = Update; - messages.affectedMessages#84d19185 pts:int pts_count:int = messages.AffectedMessages; contactLinkUnknown#5f4f9247 = ContactLink; @@ -514,14 +508,10 @@ contactLinkNone#feedd3ad = ContactLink; contactLinkHasPhone#268f3f59 = ContactLink; contactLinkContact#d502c2d0 = ContactLink; -updateWebPage#2cc36971 webpage:WebPage = Update; - webPageEmpty#eb1477e8 id:long = WebPage; webPagePending#c586da1c id:long date:int = WebPage; webPage#ca820ed7 flags:# id:long url:string display_url:string type:flags.0?string site_name:flags.1?string title:flags.2?string description:flags.3?string photo:flags.4?Photo embed_url:flags.5?string embed_type:flags.5?string embed_width:flags.6?int embed_height:flags.6?int duration:flags.7?int author:flags.8?string document:flags.9?Document = WebPage; -messageMediaWebPage#a32dd600 webpage:WebPage = MessageMedia; - authorization#7bf2e6f6 hash:long flags:int device_model:string platform:string system_version:string api_id:int app_name:string app_version:string date_created:int date_active:int ip:string country:string region:string = Authorization; account.authorizations#1250abde authorizations:Vector = account.Authorizations; @@ -535,10 +525,6 @@ account.passwordInputSettings#bcfc532c flags:# new_salt:flags.0?bytes new_passwo auth.passwordRecovery#137948a5 email_pattern:string = auth.PasswordRecovery; -inputMediaVenue#2827a81a geo_point:InputGeoPoint title:string address:string provider:string venue_id:string = InputMedia; - -messageMediaVenue#7912b71f geo:GeoPoint title:string address:string provider:string venue_id:string = MessageMedia; - receivedNotifyMessage#a384b779 id:int flags:int = ReceivedNotifyMessage; chatInviteEmpty#69df3769 = ExportedChatInvite; @@ -547,10 +533,6 @@ chatInviteExported#fc2e05bc link:string = ExportedChatInvite; chatInviteAlready#5a686d7c chat:Chat = ChatInvite; chatInvite#ce917dcd title:string = ChatInvite; -messageActionChatJoinedByLink#f89cf5e8 inviter_id:int = MessageAction; - -updateReadMessagesContents#68c13933 messages:Vector pts:int pts_count:int = Update; - inputStickerSetEmpty#ffb62b95 = InputStickerSet; inputStickerSetID#9de7a269 id:long access_hash:long = InputStickerSet; inputStickerSetShortName#861cc8a0 short_name:string = InputStickerSet; @@ -559,8 +541,6 @@ stickerSet#cd303b41 flags:# id:long access_hash:long title:string short_name:str messages.stickerSet#b60a24a6 set:StickerSet packs:Vector documents:Vector = messages.StickerSet; -user#22e49072 flags:# id:int access_hash:flags.0?long first_name:flags.1?string last_name:flags.2?string username:flags.3?string phone:flags.4?string photo:flags.5?UserProfilePhoto status:flags.6?UserStatus bot_info_version:flags.14?int = User; - botCommand#c27ac8c7 command:string description:string = BotCommand; botInfoEmpty#bb2e37ce = BotInfo; @@ -574,10 +554,6 @@ replyKeyboardHide#a03e5b85 flags:# = ReplyMarkup; replyKeyboardForceReply#f4108aa0 flags:# = ReplyMarkup; replyKeyboardMarkup#3502758c flags:# rows:Vector = ReplyMarkup; -inputPeerUser#7b8e7de6 user_id:int access_hash:long = InputPeer; - -inputUser#d8292816 user_id:int access_hash:long = InputUser; - help.appChangelogEmpty#af7e0394 = help.AppChangelog; help.appChangelog#4668e6bd text:string = help.AppChangelog; @@ -593,13 +569,13 @@ messageEntityCode#28a20571 offset:int length:int = MessageEntity; messageEntityPre#73924be0 offset:int length:int language:string = MessageEntity; messageEntityTextUrl#76a6d327 offset:int length:int url:string = MessageEntity; -updateShortSentMessage#11f1331c flags:# id:int pts:int pts_count:int date:int media:flags.9?MessageMedia entities:flags.7?Vector = Updates; - ---functions--- invokeAfterMsg#cb9f372d {X:Type} msg_id:long query:!X = X; - invokeAfterMsgs#3dc4b4f0 {X:Type} msg_ids:Vector query:!X = X; +initConnection#69796de9 {X:Type} api_id:int device_model:string system_version:string app_version:string lang_code:string query:!X = X; +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; @@ -612,6 +588,11 @@ 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; 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; @@ -621,6 +602,21 @@ account.resetNotifySettings#db7e1747 = Bool; account.updateProfile#f0888d68 first_name:string last_name:string = User; account.updateStatus#6628562c offline:Bool = Bool; account.getWallPapers#c04cfac2 = Vector; +account.checkUsername#2714d86c username:string = Bool; +account.updateUsername#3e0bdd7c username:string = User; +account.getPrivacy#dadbc950 key:InputPrivacyKey = account.PrivacyRules; +account.setPrivacy#c9f81ce8 key:InputPrivacyKey rules:Vector = account.PrivacyRules; +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.changePhone#70c32edb phone_number:string phone_code_hash:string phone_code:string = User; +account.updateDeviceLocked#38df3532 period:int = Bool; +account.getAuthorizations#e320c158 = account.Authorizations; +account.resetAuthorization#df77f3bc hash:long = Bool; +account.getPassword#548a30f5 = account.Password; +account.getPasswordSettings#bc8d11bb current_password_hash:bytes = account.PasswordSettings; +account.updatePasswordSettings#fa7c4b86 current_password_hash:bytes new_settings:account.PasswordInputSettings = Bool; users.getUsers#d91a548 id:Vector = Vector; users.getFullUser#ca30a5b1 id:InputUser = UserFull; @@ -636,6 +632,8 @@ contacts.unblock#e54100bd id:InputUser = Bool; contacts.getBlocked#f57c350f offset:int limit:int = contacts.Blocked; contacts.exportCard#84e53737 = Vector; contacts.importCard#4fe196fe export_card:Vector = User; +contacts.search#11f812d8 q:string limit:int = contacts.Found; +contacts.resolveUsername#bf0131c username:string = User; messages.getMessages#4222fa74 id:Vector = messages.Messages; messages.getDialogs#eccf1df6 offset:int max_id:int limit:int = messages.Dialogs; @@ -656,25 +654,6 @@ messages.editChatPhoto#ca4c79d8 chat_id:int photo:InputChatPhoto = Updates; messages.addChatUser#f9a0aa09 chat_id:int user_id:InputUser fwd_limit:int = Updates; messages.deleteChatUser#e0611f16 chat_id:int user_id:InputUser = Updates; messages.createChat#9cb126e users:Vector title:string = Updates; - -updates.getState#edd4882a = updates.State; -updates.getDifference#a041495 pts:int date:int qts:int = updates.Difference; - -photos.updateProfilePhoto#eef579a0 id:InputPhoto crop:InputPhotoCrop = UserProfilePhoto; -photos.uploadProfilePhoto#d50f9c88 file:InputFile caption:string geo_point:InputGeoPoint crop:InputPhotoCrop = photos.Photo; -photos.deletePhotos#87cf7f2f id:Vector = Vector; - -upload.saveFilePart#b304a621 file_id:long file_part:int bytes:bytes = Bool; -upload.getFile#e3a6cfb5 location:InputFileLocation offset:int limit:int = upload.File; - -help.getConfig#c4f9186b = Config; -help.getNearestDc#1fb33026 = NearestDc; -help.getAppUpdate#c812ac7e device_model:string system_version:string app_version:string lang_code:string = help.AppUpdate; -help.saveAppLog#6f02f748 events:Vector = Bool; -help.getInviteText#a4a95186 lang_code:string = help.InviteText; - -photos.getUserPhotos#91cd32a8 user_id:InputUser offset:int max_id:long limit:int = photos.Photos; - messages.forwardMessage#33963bf9 peer:InputPeer id:int random_id:long = Updates; messages.sendBroadcast#bf73f4da contacts:Vector random_id:Vector message:string media:InputMedia = Updates; messages.getDhConfig#26cf8950 version:int random_length:int = messages.DhConfig; @@ -687,56 +666,10 @@ messages.sendEncrypted#a9776773 peer:InputEncryptedChat random_id:long data:byte messages.sendEncryptedFile#9a901b66 peer:InputEncryptedChat random_id:long data:bytes file:InputEncryptedFile = messages.SentEncryptedMessage; messages.sendEncryptedService#32d439a4 peer:InputEncryptedChat random_id:long data:bytes = messages.SentEncryptedMessage; messages.receivedQueue#55a5bb66 max_qts:int = Vector; - -upload.saveBigFilePart#de7b673d file_id:long file_part:int file_total_parts:int bytes:bytes = Bool; - -initConnection#69796de9 {X:Type} api_id:int device_model:string system_version:string app_version:string lang_code:string query:!X = X; - -help.getSupport#9cdf08cd = help.Support; - -auth.sendSms#da9f3e8 phone_number:string phone_code_hash:string = Bool; - messages.readMessageContents#36a73f77 id:Vector = messages.AffectedMessages; - -account.checkUsername#2714d86c username:string = Bool; -account.updateUsername#3e0bdd7c username:string = User; - -contacts.search#11f812d8 q:string limit:int = contacts.Found; - -account.getPrivacy#dadbc950 key:InputPrivacyKey = account.PrivacyRules; -account.setPrivacy#c9f81ce8 key:InputPrivacyKey rules:Vector = account.PrivacyRules; -account.deleteAccount#418d4e0b reason:string = Bool; -account.getAccountTTL#8fc711d = AccountDaysTTL; -account.setAccountTTL#2442485e ttl:AccountDaysTTL = Bool; - -invokeWithLayer#da9b0d0d {X:Type} layer:int query:!X = X; - -contacts.resolveUsername#bf0131c username:string = User; - -account.sendChangePhoneCode#a407a8f4 phone_number:string = account.SentChangePhoneCode; -account.changePhone#70c32edb phone_number:string phone_code_hash:string phone_code:string = User; - messages.getStickers#ae22e045 emoticon:string hash:string = messages.Stickers; messages.getAllStickers#aa3bc868 hash:string = messages.AllStickers; - -account.updateDeviceLocked#38df3532 period:int = Bool; - -auth.importBotAuthorization#67a3ff2c flags:int api_id:int api_hash:string bot_auth_token:string = auth.Authorization; - messages.getWebPagePreview#25223e24 message:string = MessageMedia; - -account.getAuthorizations#e320c158 = account.Authorizations; -account.resetAuthorization#df77f3bc hash:long = Bool; -account.getPassword#548a30f5 = account.Password; -account.getPasswordSettings#bc8d11bb current_password_hash:bytes = account.PasswordSettings; -account.updatePasswordSettings#fa7c4b86 current_password_hash:bytes new_settings:account.PasswordInputSettings = Bool; - -auth.checkPassword#a63011e password_hash:bytes = auth.Authorization; -auth.requestPasswordRecovery#d897bc66 = auth.PasswordRecovery; -auth.recoverPassword#4ea56e92 code:string = auth.Authorization; - -invokeWithoutUpdates#bf9459b7 {X:Type} query:!X = X; - messages.exportChatInvite#7d885289 chat_id:int = ExportedChatInvite; messages.checkChatInvite#3eadb1bb hash:string = ChatInvite; messages.importChatInvite#6c50051c hash:string = Updates; @@ -744,5 +677,24 @@ messages.getStickerSet#2619a90e stickerset:InputStickerSet = messages.StickerSet messages.installStickerSet#7b30c3a6 stickerset:InputStickerSet disabled:Bool = Bool; messages.uninstallStickerSet#f96e55de stickerset:InputStickerSet = Bool; messages.startBot#1b3e0ffc bot:InputUser chat_id:int random_id:long start_param:string = Updates; +messages.reportSpam#cf1592db peer:InputPeer = Bool; +updates.getState#edd4882a = updates.State; +updates.getDifference#a041495 pts:int date:int qts:int = updates.Difference; + +photos.updateProfilePhoto#eef579a0 id:InputPhoto crop:InputPhotoCrop = UserProfilePhoto; +photos.uploadProfilePhoto#d50f9c88 file:InputFile caption:string geo_point:InputGeoPoint crop:InputPhotoCrop = photos.Photo; +photos.deletePhotos#87cf7f2f id:Vector = Vector; +photos.getUserPhotos#91cd32a8 user_id:InputUser offset:int max_id:long limit:int = photos.Photos; + +upload.saveFilePart#b304a621 file_id:long file_part:int bytes:bytes = Bool; +upload.getFile#e3a6cfb5 location:InputFileLocation offset:int limit:int = upload.File; +upload.saveBigFilePart#de7b673d file_id:long file_part:int file_total_parts:int bytes:bytes = Bool; + +help.getConfig#c4f9186b = Config; +help.getNearestDc#1fb33026 = NearestDc; +help.getAppUpdate#c812ac7e device_model:string system_version:string app_version:string lang_code:string = help.AppUpdate; +help.saveAppLog#6f02f748 events:Vector = Bool; +help.getInviteText#a4a95186 lang_code:string = help.InviteText; +help.getSupport#9cdf08cd = help.Support; help.getAppChangelog#5bab7fb2 device_model:string system_version:string app_version:string lang_code:string = help.AppChangelog; diff --git a/Telegram/SourceFiles/profilewidget.cpp b/Telegram/SourceFiles/profilewidget.cpp index 023b71e40..d8b9f185e 100644 --- a/Telegram/SourceFiles/profilewidget.cpp +++ b/Telegram/SourceFiles/profilewidget.cpp @@ -299,7 +299,8 @@ void ProfileInner::blockDone(bool blocked, const MTPBool &result) { bool ProfileInner::blockFail(const RPCError &error) { if (error.type().startsWith(qsl("FLOOD_WAIT_"))) return false; - //_blockRequest = 0; + + _blockRequest = 0; return false; } diff --git a/Telegram/SourceFiles/settings.cpp b/Telegram/SourceFiles/settings.cpp index 0e3a122b1..f7412a36c 100644 --- a/Telegram/SourceFiles/settings.cpp +++ b/Telegram/SourceFiles/settings.cpp @@ -160,8 +160,7 @@ float64 gSongVolume = 0.9; SavedPeers gSavedPeers; SavedPeersByTime gSavedPeersByTime; -ReportSpamButtons gShowReportSpamButton; -ReportSpamButtons gNoReportSpamButton; +ReportSpamStatuses gReportSpamStatuses; void settingsParseArgs(int argc, char *argv[]) { #ifdef Q_OS_MAC diff --git a/Telegram/SourceFiles/settings.h b/Telegram/SourceFiles/settings.h index a138d0cb2..e2dfa9f42 100644 --- a/Telegram/SourceFiles/settings.h +++ b/Telegram/SourceFiles/settings.h @@ -317,8 +317,7 @@ typedef QMultiMap SavedPeersByTime; DeclareRefSetting(SavedPeers, SavedPeers); DeclareRefSetting(SavedPeersByTime, SavedPeersByTime); -typedef QMap ReportSpamButtons; -DeclareRefSetting(ReportSpamButtons, ShowReportSpamButton); -DeclareRefSetting(ReportSpamButtons, NoReportSpamButton); +typedef QMap ReportSpamStatuses; +DeclareRefSetting(ReportSpamStatuses, ReportSpamStatuses); void settingsParseArgs(int argc, char *argv[]); diff --git a/Telegram/SourceFiles/types.h b/Telegram/SourceFiles/types.h index 377f92238..d88b1c290 100644 --- a/Telegram/SourceFiles/types.h +++ b/Telegram/SourceFiles/types.h @@ -357,6 +357,13 @@ enum DBIPlatform { dbipLinux32 = 3, }; +enum DBIPeerReportSpamStatus { + dbiprsNoButton, + dbiprsUnknown, + dbiprsShowButton, + dbiprsReportSent, +}; + typedef enum { HitTestNone = 0, HitTestClient, From ce678bad68b11ea5df3a616d7689fd9182b89bda Mon Sep 17 00:00:00 2001 From: John Preston Date: Wed, 9 Sep 2015 10:46:31 +0300 Subject: [PATCH 07/17] handling errors for spammers --- Telegram/Resources/lang.strings | 2 + Telegram/SourceFiles/boxes/contactsbox.cpp | 6 +- Telegram/SourceFiles/historywidget.cpp | 12 +-- Telegram/SourceFiles/mainwidget.cpp | 20 ++++- Telegram/SourceFiles/mainwidget.h | 3 +- Telegram/SourceFiles/mtproto/mtpScheme.cpp | 28 ++++--- Telegram/SourceFiles/mtproto/mtpScheme.h | 98 ++++++++++++---------- Telegram/SourceFiles/mtproto/scheme.tl | 5 +- 8 files changed, 103 insertions(+), 71 deletions(-) diff --git a/Telegram/Resources/lang.strings b/Telegram/Resources/lang.strings index 4115544b4..0804ba63b 100644 --- a/Telegram/Resources/lang.strings +++ b/Telegram/Resources/lang.strings @@ -488,6 +488,8 @@ Copyright (c) 2014 John Preston, https://desktop.telegram.org "lng_report_spam" = "Report Spam"; "lng_report_spam_hide" = "Hide"; "lng_report_spam_thanks" = "Thank you for your report!"; +"lng_cant_send_to_not_contact" = "Sorry, you can't send message to a user\nwho didn't add you to contacts right now."; +"lng_cant_invite_not_contact" = "Sorry, you can't invite a user who didn't\nadd you to contacts to groups right now."; "lng_send_button" = "Send"; "lng_message_ph" = "Write a message.."; diff --git a/Telegram/SourceFiles/boxes/contactsbox.cpp b/Telegram/SourceFiles/boxes/contactsbox.cpp index 00933bcb2..424b10b00 100644 --- a/Telegram/SourceFiles/boxes/contactsbox.cpp +++ b/Telegram/SourceFiles/boxes/contactsbox.cpp @@ -1282,7 +1282,7 @@ void CreateGroupBox::created(const MTPUpdates &updates) { } bool CreateGroupBox::failed(const RPCError &error) { - if (error.type().startsWith(qsl("FLOOD_WAIT_"))) return false; + if (mtpIsFlood(error)) return false; _createRequestId = 0; if (error.type() == "NO_CHAT_TITLE") { @@ -1291,6 +1291,10 @@ bool CreateGroupBox::failed(const RPCError &error) { } else if (error.type() == "USERS_TOO_FEW") { emit closed(); return true; + } else if (error.type() == "PEER_FLOOD") { + emit closed(); + App::wnd()->showLayer(new ConfirmBox(lang(lng_cant_invite_not_contact), true)); + return true; } return false; } diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index 50cff2659..44b91c51c 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -3576,7 +3576,7 @@ void HistoryWidget::shareContact(const PeerId &peer, const QString &phone, const sendFlags |= MTPmessages_SendMedia::flag_reply_to_msg_id; } h->addToBack(MTP_message(MTP_int(flags), MTP_int(newId), MTP_int(MTP::authedId()), App::peerToMTP(peer), 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)); - 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), RPCFailHandlerPtr(), 0, 0, h->sendRequestId); + 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); @@ -4485,7 +4485,7 @@ void HistoryWidget::onPhotoUploaded(MsgId newId, const MTPInputFile &file) { if (replyTo) { sendFlags |= MTPmessages_SendMedia::flag_reply_to_msg_id; } - hist->sendRequestId = MTP::send(MTPmessages_SendMedia(MTP_int(sendFlags), item->history()->peer->input, MTP_int(replyTo), MTP_inputMediaUploadedPhoto(file, MTP_string("")), MTP_long(randomId), MTPnullMarkup), App::main()->rpcDone(&MainWidget::sentUpdatesReceived), App::main()->rpcFail(&MainWidget::sendPhotoFailed, randomId), 0, 0, hist->sendRequestId); + hist->sendRequestId = MTP::send(MTPmessages_SendMedia(MTP_int(sendFlags), item->history()->peer->input, MTP_int(replyTo), MTP_inputMediaUploadedPhoto(file, MTP_string("")), MTP_long(randomId), MTPnullMarkup), App::main()->rpcDone(&MainWidget::sentUpdatesReceived), App::main()->rpcFail(&MainWidget::sendPhotoFail, randomId), 0, 0, hist->sendRequestId); } } @@ -4525,7 +4525,7 @@ void HistoryWidget::onDocumentUploaded(MsgId newId, const MTPInputFile &file) { if (replyTo) { sendFlags |= MTPmessages_SendMedia::flag_reply_to_msg_id; } - 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_long(randomId), MTPnullMarkup), App::main()->rpcDone(&MainWidget::sentUpdatesReceived), RPCFailHandlerPtr(), 0, 0, hist->sendRequestId); + 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_long(randomId), MTPnullMarkup), App::main()->rpcDone(&MainWidget::sentUpdatesReceived), App::main()->rpcFail(&MainWidget::sendMessageFail), 0, 0, hist->sendRequestId); } } } @@ -4549,7 +4549,7 @@ void HistoryWidget::onThumbDocumentUploaded(MsgId newId, const MTPInputFile &fil if (replyTo) { sendFlags |= MTPmessages_SendMedia::flag_reply_to_msg_id; } - 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_long(randomId), MTPnullMarkup), App::main()->rpcDone(&MainWidget::sentUpdatesReceived), RPCFailHandlerPtr(), 0, 0, hist->sendRequestId); + 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_long(randomId), MTPnullMarkup), App::main()->rpcDone(&MainWidget::sentUpdatesReceived), App::main()->rpcFail(&MainWidget::sendMessageFail), 0, 0, hist->sendRequestId); } } } @@ -4571,7 +4571,7 @@ void HistoryWidget::onAudioUploaded(MsgId newId, const MTPInputFile &file) { if (replyTo) { sendFlags |= MTPmessages_SendMedia::flag_reply_to_msg_id; } - 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), RPCFailHandlerPtr(), 0, 0, hist->sendRequestId); + 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); } } } @@ -5119,7 +5119,7 @@ void HistoryWidget::onStickerSend(DocumentData *sticker) { } _history->addToBackDocument(newId, flags, replyToId(), date(MTP_int(unixtime())), MTP::authedId(), sticker); - _history->sendRequestId = MTP::send(MTPmessages_SendMedia(MTP_int(sendFlags), _peer->input, MTP_int(replyToId()), MTP_inputMediaDocument(MTP_inputDocument(MTP_long(sticker->id), MTP_long(sticker->access))), MTP_long(randomId), MTPnullMarkup), App::main()->rpcDone(&MainWidget::sentUpdatesReceived), RPCFailHandlerPtr(), 0, 0, _history->sendRequestId); + _history->sendRequestId = MTP::send(MTPmessages_SendMedia(MTP_int(sendFlags), _peer->input, MTP_int(replyToId()), MTP_inputMediaDocument(MTP_inputDocument(MTP_long(sticker->id), MTP_long(sticker->access))), MTP_long(randomId), MTPnullMarkup), App::main()->rpcDone(&MainWidget::sentUpdatesReceived), App::main()->rpcFail(&MainWidget::sendMessageFail), 0, 0, _history->sendRequestId); App::main()->finishForwarding(_history); cancelReply(lastKeyboardUsed); diff --git a/Telegram/SourceFiles/mainwidget.cpp b/Telegram/SourceFiles/mainwidget.cpp index 98e083daf..da7d92fb9 100644 --- a/Telegram/SourceFiles/mainwidget.cpp +++ b/Telegram/SourceFiles/mainwidget.cpp @@ -822,6 +822,8 @@ bool MainWidget::addParticipantFail(UserData *user, const RPCError &error) { text = lang(lng_failed_add_not_mutual); } else if (error.type() == "USER_ALREADY_PARTICIPANT" && user->botInfo) { text = lang(lng_bot_already_in_group); + } else if (error.type() == "PEER_FLOOD") { + text = lang(lng_cant_invite_not_contact); } App::wnd()->showLayer(new ConfirmBox(text, true)); return false; @@ -877,7 +879,7 @@ void MainWidget::checkedHistory(PeerData *peer, const MTPmessages_Messages &resu } } -bool MainWidget::sendPhotoFailed(uint64 randomId, const RPCError &error) { +bool MainWidget::sendPhotoFail(uint64 randomId, const RPCError &error) { if (mtpIsFlood(error)) return false; if (error.type() == qsl("PHOTO_INVALID_DIMENSIONS")) { @@ -891,6 +893,16 @@ bool MainWidget::sendPhotoFailed(uint64 randomId, const RPCError &error) { _resendImgRandomIds.push_back(randomId); return true; } + return sendMessageFail(error); +} + +bool MainWidget::sendMessageFail(const RPCError &error) { + if (mtpIsFlood(error)) return false; + + if (error.type() == qsl("PEER_FLOOD")) { + App::wnd()->showLayer(new ConfirmBox(lang(lng_cant_send_to_not_contact), true)); + return true; + } return false; } @@ -1073,7 +1085,7 @@ void MainWidget::sendPreparedText(History *hist, const QString &text, MsgId repl } MTPVector localEntities = linksToMTP(textParseLinks(sendingText, itemTextParseOptions(hist, App::self()).flags)); hist->addToBack(MTP_message(MTP_int(flags), MTP_int(newId), MTP_int(MTP::authedId()), App::peerToMTP(hist->peer->id), MTPint(), MTPint(), MTP_int(replyTo), MTP_int(unixtime()), msgText, media, MTPnullMarkup, localEntities)); - hist->sendRequestId = MTP::send(MTPmessages_SendMessage(MTP_int(sendFlags), hist->peer->input, MTP_int(replyTo), msgText, MTP_long(randomId), MTPnullMarkup, localEntities), App::main()->rpcDone(&MainWidget::sentUpdatesReceived, randomId), RPCFailHandlerPtr(), 0, 0, hist->sendRequestId); + hist->sendRequestId = MTP::send(MTPmessages_SendMessage(MTP_int(sendFlags), hist->peer->input, MTP_int(replyTo), msgText, MTP_long(randomId), MTPnullMarkup, localEntities), rpcDone(&MainWidget::sentUpdatesReceived, randomId), rpcFail(&MainWidget::sendMessageFail), 0, 0, hist->sendRequestId); } finishForwarding(hist); @@ -3560,6 +3572,10 @@ void MainWidget::feedUpdate(const MTPUpdate &update) { case mtpc_updateWebPage: { const MTPDupdateWebPage &d(update.c_updateWebPage()); + if (!updPtsUpdated(d.vpts.v, d.vpts_count.v)) { + _byPtsUpdate.insert(ptsKey(SkippedUpdate), update); + return; + } App::feedWebPage(d.vwebpage); history.updatePreview(); webPagesUpdate(); diff --git a/Telegram/SourceFiles/mainwidget.h b/Telegram/SourceFiles/mainwidget.h index f055081be..cb1834d37 100644 --- a/Telegram/SourceFiles/mainwidget.h +++ b/Telegram/SourceFiles/mainwidget.h @@ -300,7 +300,8 @@ public: void checkPeerHistory(PeerData *peer); void checkedHistory(PeerData *peer, const MTPmessages_Messages &result); - bool sendPhotoFailed(uint64 randomId, const RPCError &e); + bool sendPhotoFail(uint64 randomId, const RPCError &e); + bool sendMessageFail(const RPCError &error); void forwardSelectedItems(); void deleteSelectedItems(); diff --git a/Telegram/SourceFiles/mtproto/mtpScheme.cpp b/Telegram/SourceFiles/mtproto/mtpScheme.cpp index 79d35b846..9764c21b8 100644 --- a/Telegram/SourceFiles/mtproto/mtpScheme.cpp +++ b/Telegram/SourceFiles/mtproto/mtpScheme.cpp @@ -2600,6 +2600,8 @@ void mtpTextSerializeType(MTPStringLogger &to, const mtpPrime *&from, const mtpP } 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; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } break; @@ -4709,6 +4711,19 @@ void mtpTextSerializeType(MTPStringLogger &to, const mtpPrime *&from, const mtpP } break; + case mtpc_messages_reportSpam: + if (stage) { + to.add(",\n").addSpaces(lev); + } else { + to.add("{ messages_reportSpam"); + 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; + } + break; + case mtpc_messages_discardEncryption: if (stage) { to.add(",\n").addSpaces(lev); @@ -4777,19 +4792,6 @@ void mtpTextSerializeType(MTPStringLogger &to, const mtpPrime *&from, const mtpP } break; - case mtpc_messages_reportSpam: - if (stage) { - to.add(",\n").addSpaces(lev); - } else { - to.add("{ messages_reportSpam"); - 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; - } - break; - case mtpc_upload_saveFilePart: if (stage) { to.add(",\n").addSpaces(lev); diff --git a/Telegram/SourceFiles/mtproto/mtpScheme.h b/Telegram/SourceFiles/mtproto/mtpScheme.h index 9fc3f6af5..9df54b587 100644 --- a/Telegram/SourceFiles/mtproto/mtpScheme.h +++ b/Telegram/SourceFiles/mtproto/mtpScheme.h @@ -243,7 +243,7 @@ enum { mtpc_updateUserPhone = 0x12b9417b, mtpc_updateReadHistoryInbox = 0x9961fd5c, mtpc_updateReadHistoryOutbox = 0x2f2f21bf, - mtpc_updateWebPage = 0x2cc36971, + mtpc_updateWebPage = 0x7f891213, mtpc_updateReadMessagesContents = 0x68c13933, mtpc_updates_state = 0xa56c2a3e, mtpc_updates_differenceEmpty = 0x5d75a138, @@ -455,6 +455,7 @@ enum { mtpc_messages_sendMessage = 0xfa88427a, mtpc_messages_sendMedia = 0xc8f16791, mtpc_messages_forwardMessages = 0x55e1728d, + mtpc_messages_reportSpam = 0xcf1592db, mtpc_messages_getChats = 0x3c6aa187, mtpc_messages_getFullChat = 0x3b831c66, mtpc_messages_editChatTitle = 0xdc452855, @@ -485,7 +486,6 @@ enum { mtpc_messages_installStickerSet = 0x7b30c3a6, mtpc_messages_uninstallStickerSet = 0xf96e55de, mtpc_messages_startBot = 0x1b3e0ffc, - mtpc_messages_reportSpam = 0xcf1592db, mtpc_updates_getState = 0xedd4882a, mtpc_updates_getDifference = 0xa041495, mtpc_photos_updateProfilePhoto = 0xeef579a0, @@ -5133,7 +5133,7 @@ private: 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); + friend MTPupdate MTP_updateWebPage(const MTPWebPage &_webpage, MTPint _pts, MTPint _pts_count); friend MTPupdate MTP_updateReadMessagesContents(const MTPVector &_messages, MTPint _pts, MTPint _pts_count); mtpTypeId _type; @@ -9755,10 +9755,12 @@ class MTPDupdateWebPage : public mtpDataImpl { public: MTPDupdateWebPage() { } - MTPDupdateWebPage(const MTPWebPage &_webpage) : vwebpage(_webpage) { + MTPDupdateWebPage(const MTPWebPage &_webpage, MTPint _pts, MTPint _pts_count) : vwebpage(_webpage), vpts(_pts), vpts_count(_pts_count) { } MTPWebPage vwebpage; + MTPint vpts; + MTPint vpts_count; }; class MTPDupdateReadMessagesContents : public mtpDataImpl { @@ -14406,6 +14408,45 @@ public: } }; +class MTPmessages_reportSpam { // RPC method 'messages.reportSpam' +public: + MTPInputPeer vpeer; + + MTPmessages_reportSpam() { + } + MTPmessages_reportSpam(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_messages_reportSpam) { + read(from, end, cons); + } + MTPmessages_reportSpam(const MTPInputPeer &_peer) : vpeer(_peer) { + } + + uint32 innerLength() const { + return vpeer.innerLength(); + } + mtpTypeId type() const { + return mtpc_messages_reportSpam; + } + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_messages_reportSpam) { + vpeer.read(from, end); + } + void write(mtpBuffer &to) const { + vpeer.write(to); + } + + typedef MTPBool ResponseType; +}; +class MTPmessages_ReportSpam : public MTPBoxed { +public: + MTPmessages_ReportSpam() { + } + MTPmessages_ReportSpam(const MTPmessages_reportSpam &v) : MTPBoxed(v) { + } + MTPmessages_ReportSpam(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { + } + MTPmessages_ReportSpam(const MTPInputPeer &_peer) : MTPBoxed(MTPmessages_reportSpam(_peer)) { + } +}; + class MTPmessages_getChats { // RPC method 'messages.getChats' public: MTPVector vid; @@ -15666,45 +15707,6 @@ public: } }; -class MTPmessages_reportSpam { // RPC method 'messages.reportSpam' -public: - MTPInputPeer vpeer; - - MTPmessages_reportSpam() { - } - MTPmessages_reportSpam(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_messages_reportSpam) { - read(from, end, cons); - } - MTPmessages_reportSpam(const MTPInputPeer &_peer) : vpeer(_peer) { - } - - uint32 innerLength() const { - return vpeer.innerLength(); - } - mtpTypeId type() const { - return mtpc_messages_reportSpam; - } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_messages_reportSpam) { - vpeer.read(from, end); - } - void write(mtpBuffer &to) const { - vpeer.write(to); - } - - typedef MTPBool ResponseType; -}; -class MTPmessages_ReportSpam : public MTPBoxed { -public: - MTPmessages_ReportSpam() { - } - MTPmessages_ReportSpam(const MTPmessages_reportSpam &v) : MTPBoxed(v) { - } - MTPmessages_ReportSpam(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { - } - MTPmessages_ReportSpam(const MTPInputPeer &_peer) : MTPBoxed(MTPmessages_reportSpam(_peer)) { - } -}; - class MTPupdates_getState { // RPC method 'updates.getState' public: MTPupdates_getState() { @@ -21082,7 +21084,7 @@ inline uint32 MTPupdate::innerLength() const { } case mtpc_updateWebPage: { const MTPDupdateWebPage &v(c_updateWebPage()); - return v.vwebpage.innerLength(); + return v.vwebpage.innerLength() + v.vpts.innerLength() + v.vpts_count.innerLength(); } case mtpc_updateReadMessagesContents: { const MTPDupdateReadMessagesContents &v(c_updateReadMessagesContents()); @@ -21276,6 +21278,8 @@ inline void MTPupdate::read(const mtpPrime *&from, const mtpPrime *end, mtpTypeI if (!data) setData(new MTPDupdateWebPage()); MTPDupdateWebPage &v(_updateWebPage()); v.vwebpage.read(from, end); + v.vpts.read(from, end); + v.vpts_count.read(from, end); } break; case mtpc_updateReadMessagesContents: _type = cons; { if (!data) setData(new MTPDupdateReadMessagesContents()); @@ -21440,6 +21444,8 @@ inline void MTPupdate::write(mtpBuffer &to) const { case mtpc_updateWebPage: { const MTPDupdateWebPage &v(c_updateWebPage()); v.vwebpage.write(to); + v.vpts.write(to); + v.vpts_count.write(to); } break; case mtpc_updateReadMessagesContents: { const MTPDupdateReadMessagesContents &v(c_updateReadMessagesContents()); @@ -21616,8 +21622,8 @@ inline MTPupdate MTP_updateReadHistoryInbox(const MTPPeer &_peer, MTPint _max_id 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)); } -inline MTPupdate MTP_updateWebPage(const MTPWebPage &_webpage) { - return MTPupdate(new MTPDupdateWebPage(_webpage)); +inline MTPupdate MTP_updateWebPage(const MTPWebPage &_webpage, MTPint _pts, MTPint _pts_count) { + return MTPupdate(new MTPDupdateWebPage(_webpage, _pts, _pts_count)); } inline MTPupdate MTP_updateReadMessagesContents(const MTPVector &_messages, MTPint _pts, MTPint _pts_count) { return MTPupdate(new MTPDupdateReadMessagesContents(_messages, _pts, _pts_count)); diff --git a/Telegram/SourceFiles/mtproto/scheme.tl b/Telegram/SourceFiles/mtproto/scheme.tl index 33fb1f125..c6e55ae2c 100644 --- a/Telegram/SourceFiles/mtproto/scheme.tl +++ b/Telegram/SourceFiles/mtproto/scheme.tl @@ -126,6 +126,7 @@ register.saveDeveloperInfo#9a5f6e95 name:string email:string phone_number:string ---types--- + error#c4b9f9bb code:int text:string = Error; null#56730bcc = Null; @@ -366,7 +367,7 @@ updatePrivacy#ee3b272a key:PrivacyKey rules:Vector = Update; updateUserPhone#12b9417b user_id:int phone:string = Update; updateReadHistoryInbox#9961fd5c peer:Peer max_id:int pts:int pts_count:int = Update; updateReadHistoryOutbox#2f2f21bf peer:Peer max_id:int pts:int pts_count:int = Update; -updateWebPage#2cc36971 webpage:WebPage = Update; +updateWebPage#7f891213 webpage:WebPage pts:int pts_count:int = Update; updateReadMessagesContents#68c13933 messages:Vector pts:int pts_count:int = Update; updates.state#a56c2a3e pts:int qts:int date:int seq:int unread_count:int = updates.State; @@ -647,6 +648,7 @@ messages.setTyping#a3825e50 peer:InputPeer action:SendMessageAction = Bool; messages.sendMessage#fa88427a flags:# 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:# peer:InputPeer reply_to_msg_id:flags.0?int media:InputMedia random_id:long reply_markup:flags.2?ReplyMarkup = Updates; messages.forwardMessages#55e1728d peer:InputPeer id:Vector random_id:Vector = Updates; +messages.reportSpam#cf1592db peer:InputPeer = Bool; messages.getChats#3c6aa187 id:Vector = messages.Chats; messages.getFullChat#3b831c66 chat_id:int = messages.ChatFull; messages.editChatTitle#dc452855 chat_id:int title:string = Updates; @@ -677,7 +679,6 @@ messages.getStickerSet#2619a90e stickerset:InputStickerSet = messages.StickerSet messages.installStickerSet#7b30c3a6 stickerset:InputStickerSet disabled:Bool = Bool; messages.uninstallStickerSet#f96e55de stickerset:InputStickerSet = Bool; messages.startBot#1b3e0ffc bot:InputUser chat_id:int random_id:long start_param:string = Updates; -messages.reportSpam#cf1592db peer:InputPeer = Bool; updates.getState#edd4882a = updates.State; updates.getDifference#a041495 pts:int date:int qts:int = updates.Difference; From 0a80ef0006b35108883b086980b4b66693a15ea9 Mon Sep 17 00:00:00 2001 From: John Preston Date: Wed, 9 Sep 2015 11:19:25 +0300 Subject: [PATCH 08/17] writing report spam statuses to local storage --- Telegram/SourceFiles/app.cpp | 1 + Telegram/SourceFiles/localstorage.cpp | 109 +++++++++++++++++++++----- 2 files changed, 92 insertions(+), 18 deletions(-) diff --git a/Telegram/SourceFiles/app.cpp b/Telegram/SourceFiles/app.cpp index b598b067f..3e142c73f 100644 --- a/Telegram/SourceFiles/app.cpp +++ b/Telegram/SourceFiles/app.cpp @@ -1743,6 +1743,7 @@ namespace App { cSetStickerSets(StickerSets()); cSetStickerSetsOrder(StickerSetsOrder()); cSetLastStickersUpdate(0); + cSetReportSpamStatuses(ReportSpamStatuses()); ::videoItems.clear(); ::audioItems.clear(); ::documentItems.clear(); diff --git a/Telegram/SourceFiles/localstorage.cpp b/Telegram/SourceFiles/localstorage.cpp index 56fab4908..640b5c27d 100644 --- a/Telegram/SourceFiles/localstorage.cpp +++ b/Telegram/SourceFiles/localstorage.cpp @@ -495,19 +495,20 @@ namespace { FileKey _dataNameKey = 0; enum { // Local Storage Keys - lskUserMap = 0x00, - lskDraft = 0x01, // data: PeerId peer - lskDraftPosition = 0x02, // data: PeerId peer - lskImages = 0x03, // data: StorageKey location - lskLocations = 0x04, // no data - lskStickerImages = 0x05, // data: StorageKey location - lskAudios = 0x06, // data: StorageKey location - lskRecentStickersOld = 0x07, // no data - lskBackground = 0x08, // no data - lskUserSettings = 0x09, // no data - lskRecentHashtags = 0x0a, // no data - lskStickers = 0x0b, // no data - lskSavedPeers = 0x0c, // no data + lskUserMap = 0x00, + lskDraft = 0x01, // data: PeerId peer + lskDraftPosition = 0x02, // data: PeerId peer + lskImages = 0x03, // data: StorageKey location + lskLocations = 0x04, // no data + lskStickerImages = 0x05, // data: StorageKey location + lskAudios = 0x06, // data: StorageKey location + lskRecentStickersOld = 0x07, // no data + lskBackground = 0x08, // no data + lskUserSettings = 0x09, // no data + lskRecentHashtags = 0x0a, // no data + lskStickers = 0x0b, // no data + lskSavedPeers = 0x0c, // no data + lskReportSpamStatuses = 0x0d, // no data }; typedef QMap DraftsMap; @@ -522,7 +523,7 @@ namespace { FileLocationPairs _fileLocationPairs; typedef QMap FileLocationAliases; FileLocationAliases _fileLocationAliases; - FileKey _locationsKey = 0; + FileKey _locationsKey = 0, _reportSpamStatusesKey = 0; FileKey _recentStickersKeyOld = 0, _stickersKey = 0; @@ -550,7 +551,7 @@ namespace { }; void _writeMap(WriteMapWhen when = WriteMapSoon); - + void _writeLocations(WriteMapWhen when = WriteMapSoon) { if (when != WriteMapNow) { _manager->writeLocations(when == WriteMapFast); @@ -643,6 +644,63 @@ namespace { } } + void _writeReportSpamStatuses() { + if (!_working()) return; + + if (cReportSpamStatuses().isEmpty()) { + if (_reportSpamStatusesKey) { + clearKey(_reportSpamStatusesKey); + _reportSpamStatusesKey = 0; + _mapChanged = true; + _writeMap(); + } + } else { + if (!_reportSpamStatusesKey) { + _reportSpamStatusesKey = genKey(); + _mapChanged = true; + _writeMap(WriteMapFast); + } + const ReportSpamStatuses &statuses(cReportSpamStatuses()); + + quint32 size = sizeof(qint32); + for (ReportSpamStatuses::const_iterator i = statuses.cbegin(), e = statuses.cend(); i != e; ++i) { + // peer + status + size += sizeof(quint64) + sizeof(qint32); + } + + EncryptedDescriptor data(size); + data.stream << qint32(statuses.size()); + for (ReportSpamStatuses::const_iterator i = statuses.cbegin(), e = statuses.cend(); i != e; ++i) { + data.stream << quint64(i.key()) << qint32(i.value()); + } + + FileWriteDescriptor file(_reportSpamStatusesKey); + file.writeEncrypted(data); + } + } + + void _readReportSpamStatuses() { + FileReadDescriptor statuses; + if (!readEncryptedFile(statuses, _reportSpamStatusesKey)) { + clearKey(_reportSpamStatusesKey); + _reportSpamStatusesKey = 0; + _writeMap(); + return; + } + + ReportSpamStatuses &map(cRefReportSpamStatuses()); + map.clear(); + + qint32 size = 0; + statuses.stream >> size; + for (int32 i = 0; i < size; ++i) { + quint64 peer = 0; + qint32 status = 0; + statuses.stream >> peer >> status; + map.insert(peer, DBIPeerReportSpamStatus(status)); + } + } + mtpDcOptions *_dcOpts = 0; bool _readSetting(quint32 blockId, QDataStream &stream, int version) { switch (blockId) { @@ -1458,7 +1516,7 @@ namespace { DraftsNotReadMap draftsNotReadMap; StorageMap imagesMap, stickerImagesMap, audiosMap; qint64 storageImagesSize = 0, storageStickersSize = 0, storageAudiosSize = 0; - quint64 locationsKey = 0, recentStickersKeyOld = 0, stickersKey = 0, backgroundKey = 0, userSettingsKey = 0, recentHashtagsKey = 0, savedPeersKey = 0; + quint64 locationsKey = 0, reportSpamStatusesKey = 0, recentStickersKeyOld = 0, stickersKey = 0, backgroundKey = 0, userSettingsKey = 0, recentHashtagsKey = 0, savedPeersKey = 0; while (!map.stream.atEnd()) { quint32 keyType; map.stream >> keyType; @@ -1523,6 +1581,9 @@ namespace { case lskLocations: { map.stream >> locationsKey; } break; + case lskReportSpamStatuses: { + map.stream >> reportSpamStatusesKey; + } break; case lskRecentStickersOld: { map.stream >> recentStickersKeyOld; } break; @@ -1562,6 +1623,7 @@ namespace { _storageAudiosSize = storageAudiosSize; _locationsKey = locationsKey; + _reportSpamStatusesKey = reportSpamStatusesKey; _recentStickersKeyOld = recentStickersKeyOld; _stickersKey = stickersKey; _savedPeersKey = savedPeersKey; @@ -1579,6 +1641,9 @@ namespace { if (_locationsKey) { _readLocations(); } + if (_reportSpamStatusesKey) { + _readReportSpamStatuses(); + } _readUserSettings(); _readMtpData(); @@ -1630,6 +1695,7 @@ namespace { 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)); if (_locationsKey) mapSize += sizeof(quint32) + sizeof(quint64); + if (_reportSpamStatusesKey) mapSize += sizeof(quint32) + sizeof(quint64); if (_recentStickersKeyOld) mapSize += sizeof(quint32) + sizeof(quint64); if (_stickersKey) mapSize += sizeof(quint32) + sizeof(quint64); if (_savedPeersKey) mapSize += sizeof(quint32) + sizeof(quint64); @@ -1670,6 +1736,9 @@ namespace { if (_locationsKey) { mapData.stream << quint32(lskLocations) << quint64(_locationsKey); } + if (_reportSpamStatusesKey) { + mapData.stream << quint32(lskReportSpamStatuses) << quint64(_reportSpamStatusesKey); + } if (_recentStickersKeyOld) { mapData.stream << quint32(lskRecentStickersOld) << quint64(_recentStickersKeyOld); } @@ -1938,7 +2007,7 @@ namespace Local { _draftsNotReadMap.clear(); _stickerImagesMap.clear(); _audiosMap.clear(); - _locationsKey = _recentStickersKeyOld = _stickersKey = _backgroundKey = _userSettingsKey = _recentHashtagsKey = _savedPeersKey = 0; + _locationsKey = _reportSpamStatusesKey = _recentStickersKeyOld = _stickersKey = _backgroundKey = _userSettingsKey = _recentHashtagsKey = _savedPeersKey = 0; _mapChanged = true; _writeMap(WriteMapNow); @@ -2945,7 +3014,7 @@ namespace Local { } void writeReportSpamStatuses() { - + _writeReportSpamStatuses(); } struct ClearManagerData { @@ -2995,6 +3064,10 @@ namespace Local { _locationsKey = 0; _mapChanged = true; } + if (_reportSpamStatusesKey) { + _reportSpamStatusesKey = 0; + _mapChanged = true; + } if (_recentStickersKeyOld) { _recentStickersKeyOld = 0; _mapChanged = true; From f6740f6c9ee44def2872b6f0c13a4ba9b69b4657 Mon Sep 17 00:00:00 2001 From: John Preston Date: Wed, 9 Sep 2015 18:17:20 +0300 Subject: [PATCH 09/17] langs updated --- Telegram/Resources/lang.strings | 7 ++++--- Telegram/SourceFiles/boxes/contactsbox.cpp | 2 +- Telegram/SourceFiles/mainwidget.cpp | 4 ++-- Telegram/_openal_patch.diff | 6 +++--- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/Telegram/Resources/lang.strings b/Telegram/Resources/lang.strings index 0804ba63b..4d0f0cce7 100644 --- a/Telegram/Resources/lang.strings +++ b/Telegram/Resources/lang.strings @@ -488,8 +488,9 @@ Copyright (c) 2014 John Preston, https://desktop.telegram.org "lng_report_spam" = "Report Spam"; "lng_report_spam_hide" = "Hide"; "lng_report_spam_thanks" = "Thank you for your report!"; -"lng_cant_send_to_not_contact" = "Sorry, you can't send message to a user\nwho didn't add you to contacts right now."; -"lng_cant_invite_not_contact" = "Sorry, you can't invite a user who didn't\nadd you to contacts to groups right now."; +"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_more_info" = "More info »"; "lng_send_button" = "Send"; "lng_message_ph" = "Write a message.."; @@ -654,7 +655,7 @@ Copyright (c) 2014 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" = "— Include muted chats in unread count in Settings\n— Shared links overview and search in shared media\n— Preview when sending links to GIF animations and PDF files"; +"lng_new_version_text" = "— Spam report buttons in new chats\n— Other fixes and improvements\n— OS X 10.8 notifications fixed"; "lng_menu_insert_unicode" = "Insert Unicode control character"; diff --git a/Telegram/SourceFiles/boxes/contactsbox.cpp b/Telegram/SourceFiles/boxes/contactsbox.cpp index 424b10b00..eab47a3dc 100644 --- a/Telegram/SourceFiles/boxes/contactsbox.cpp +++ b/Telegram/SourceFiles/boxes/contactsbox.cpp @@ -1293,7 +1293,7 @@ bool CreateGroupBox::failed(const RPCError &error) { return true; } else if (error.type() == "PEER_FLOOD") { emit closed(); - App::wnd()->showLayer(new ConfirmBox(lang(lng_cant_invite_not_contact), true)); + App::wnd()->showLayer(new ConfirmBox(lng_cant_invite_not_contact(lt_more_info, QString()), true)); return true; } return false; diff --git a/Telegram/SourceFiles/mainwidget.cpp b/Telegram/SourceFiles/mainwidget.cpp index da7d92fb9..5e4bfd66d 100644 --- a/Telegram/SourceFiles/mainwidget.cpp +++ b/Telegram/SourceFiles/mainwidget.cpp @@ -823,7 +823,7 @@ bool MainWidget::addParticipantFail(UserData *user, const RPCError &error) { } else if (error.type() == "USER_ALREADY_PARTICIPANT" && user->botInfo) { text = lang(lng_bot_already_in_group); } else if (error.type() == "PEER_FLOOD") { - text = lang(lng_cant_invite_not_contact); + text = lng_cant_invite_not_contact(lt_more_info, QString()); } App::wnd()->showLayer(new ConfirmBox(text, true)); return false; @@ -900,7 +900,7 @@ bool MainWidget::sendMessageFail(const RPCError &error) { if (mtpIsFlood(error)) return false; if (error.type() == qsl("PEER_FLOOD")) { - App::wnd()->showLayer(new ConfirmBox(lang(lng_cant_send_to_not_contact), true)); + App::wnd()->showLayer(new ConfirmBox(lng_cant_send_to_not_contact(lt_more_info, QString()), true)); return true; } return false; diff --git a/Telegram/_openal_patch.diff b/Telegram/_openal_patch.diff index 951e0e1c0..5eda24496 100644 --- a/Telegram/_openal_patch.diff +++ b/Telegram/_openal_patch.diff @@ -12,7 +12,7 @@ index cfd12d8..8a6f9fb 100644 return ALC_FALSE; } diff --git a/Alc/backends/winmm.c b/Alc/backends/winmm.c -index 03805ab..77212c2 100644 +index 03805ab..5035a36 100644 --- a/Alc/backends/winmm.c +++ b/Alc/backends/winmm.c @@ -220,7 +220,7 @@ FORCE_ALIGN static int ALCwinmmPlayback_mixerProc(void *arg) @@ -20,7 +20,7 @@ index 03805ab..77212c2 100644 althrd_setname(althrd_current(), MIXER_THREAD_NAME); - while(GetMessage(&msg, NULL, 0, 0)) -+ if (!self->killNow) while (GetMessage(&msg, NULL, 0, 0)) ++ if (!self->killNow) while(GetMessage(&msg, NULL, 0, 0)) { if(msg.message != WOM_DONE) continue; @@ -29,7 +29,7 @@ index 03805ab..77212c2 100644 althrd_setname(althrd_current(), RECORD_THREAD_NAME); - while(GetMessage(&msg, NULL, 0, 0)) -+ if (!self->killNow) while(GetMessage(&msg, NULL, 0, 0)) ++ if (!self->killNow) while (GetMessage(&msg, NULL, 0, 0)) { if(msg.message != WIM_DATA) continue; From 7bc27ba0bf20a7430b77f41155b88d1d3da76317 Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 10 Sep 2015 13:30:59 +0300 Subject: [PATCH 10/17] fixed item resize on entities receive --- Telegram/SourceFiles/app.cpp | 2 +- Telegram/SourceFiles/boxes/contactsbox.cpp | 2 +- Telegram/SourceFiles/history.cpp | 81 +++++++++++----------- Telegram/SourceFiles/history.h | 45 ++++++------ Telegram/SourceFiles/historywidget.cpp | 8 +-- Telegram/SourceFiles/historywidget.h | 2 +- Telegram/SourceFiles/mainwidget.cpp | 6 +- Telegram/SourceFiles/mtproto/scheme.tl | 1 - 8 files changed, 73 insertions(+), 74 deletions(-) diff --git a/Telegram/SourceFiles/app.cpp b/Telegram/SourceFiles/app.cpp index 3e142c73f..10a0e7e75 100644 --- a/Telegram/SourceFiles/app.cpp +++ b/Telegram/SourceFiles/app.cpp @@ -722,7 +722,7 @@ namespace App { bool hasLinks = m.has_entities() && !m.ventities.c_vector().v.isEmpty(); if ((hasLinks && !existing->hasTextLinks()) || (!hasLinks && existing->textHasLinks())) { existing->setText(qs(m.vmessage), m.has_entities() ? linksFromMTP(m.ventities.c_vector().v) : LinksInText()); - existing->initDimensions(0); + existing->initDimensions(); if (App::main()) App::main()->itemResized(existing); if (existing->hasTextLinks()) { existing->history()->addToOverview(existing, OverviewLinks); diff --git a/Telegram/SourceFiles/boxes/contactsbox.cpp b/Telegram/SourceFiles/boxes/contactsbox.cpp index eab47a3dc..e11a996e2 100644 --- a/Telegram/SourceFiles/boxes/contactsbox.cpp +++ b/Telegram/SourceFiles/boxes/contactsbox.cpp @@ -1293,7 +1293,7 @@ bool CreateGroupBox::failed(const RPCError &error) { return true; } else if (error.type() == "PEER_FLOOD") { emit closed(); - App::wnd()->showLayer(new ConfirmBox(lng_cant_invite_not_contact(lt_more_info, QString()), true)); + App::wnd()->showLayer(new ConfirmBox(lng_cant_invite_not_contact(lt_more_info, textcmdLink(qsl("https://telegram.org/faq#can-39t-send-messages-to-non-contacts"), lang(lng_cant_more_info)))), true); return true; } return false; diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index e5c3ead6d..9b2d0aa6a 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -1490,8 +1490,9 @@ MsgId History::maxMsgId() const { return 0; } -int32 History::geomResize(int32 newWidth, int32 *ytransform, bool dontRecountText) { - if (width != newWidth || dontRecountText) { +int32 History::geomResize(int32 newWidth, int32 *ytransform, HistoryItem *resizedItem) { + if (width != newWidth) resizedItem = 0; // recount all items + if (width != newWidth || resizedItem) { int32 y = 0; for (iterator i = begin(), e = end(); i != e; ++i) { HistoryBlock *block = *i; @@ -1500,7 +1501,7 @@ int32 History::geomResize(int32 newWidth, int32 *ytransform, bool dontRecountTex if (block->y != y) { block->y = y; } - y += block->geomResize(newWidth, ytransform, dontRecountText); + y += block->geomResize(newWidth, ytransform, resizedItem); if (updTransform) { *ytransform += block->y; ytransform = 0; @@ -1589,14 +1590,18 @@ void History::removeBlock(HistoryBlock *block) { delete block; } -int32 HistoryBlock::geomResize(int32 newWidth, int32 *ytransform, bool dontRecountText) { +int32 HistoryBlock::geomResize(int32 newWidth, int32 *ytransform, HistoryItem *resizedItem) { int32 y = 0; for (iterator i = begin(), e = end(); i != e; ++i) { HistoryItem *item = *i; bool updTransform = ytransform && (*ytransform >= item->y) && (*ytransform < item->y + item->height()); if (updTransform) *ytransform -= item->y; item->y = y; - y += item->resize(newWidth, dontRecountText); + if (!resizedItem || resizedItem == item) { + y += item->resize(newWidth); + } else { + y += item->height(); + } if (updTransform) { *ytransform += item->y; ytransform = 0; @@ -1895,7 +1900,7 @@ void HistoryPhoto::initDimensions(const HistoryItem *parent) { } } -int32 HistoryPhoto::resize(int32 width, bool dontRecountText, const HistoryItem *parent) { +int32 HistoryPhoto::resize(int32 width, const HistoryItem *parent) { const HistoryReply *reply = toHistoryReply(parent); const HistoryForwarded *fwd = reply ? 0 : toHistoryForwarded(parent); @@ -2615,7 +2620,7 @@ void HistoryVideo::draw(QPainter &p, const HistoryItem *parent, bool selected, i } } -int32 HistoryVideo::resize(int32 width, bool dontRecountText, const HistoryItem *parent) { +int32 HistoryVideo::resize(int32 width, const HistoryItem *parent) { w = qMin(width, _maxw); if (_caption.isEmpty()) return _height; @@ -3349,7 +3354,7 @@ void HistoryDocument::updateFrom(const MTPMessageMedia &media) { } } -int32 HistoryDocument::resize(int32 width, bool dontRecountText, const HistoryItem *parent) { +int32 HistoryDocument::resize(int32 width, const HistoryItem *parent) { w = qMin(width, _maxw); if (parent == animated.msg) { if (w > st::maxMediaSize) { @@ -3591,7 +3596,7 @@ void HistorySticker::draw(QPainter &p, const HistoryItem *parent, bool selected, } } -int32 HistorySticker::resize(int32 width, bool dontRecountText, const HistoryItem *parent) { +int32 HistorySticker::resize(int32 width, const HistoryItem *parent) { w = qMin(width, _maxw); lastw = width; return _height; @@ -4288,7 +4293,7 @@ void HistoryWebPage::draw(QPainter &p, const HistoryItem *parent, bool selected, p.restore(); } -int32 HistoryWebPage::resize(int32 width, bool dontRecountText, const HistoryItem *parent) { +int32 HistoryWebPage::resize(int32 width, const HistoryItem *parent) { if (data->pendingTill) { w = width; _height = _minh; @@ -5087,7 +5092,7 @@ void HistoryImageLink::draw(QPainter &p, const HistoryItem *parent, bool selecte } } -int32 HistoryImageLink::resize(int32 width, bool dontRecountText, const HistoryItem *parent) { +int32 HistoryImageLink::resize(int32 width, const HistoryItem *parent) { const HistoryReply *reply = toHistoryReply(parent); const HistoryForwarded *fwd = toHistoryForwarded(parent); @@ -5373,7 +5378,7 @@ void HistoryMessage::initMediaFromDocument(DocumentData *doc) { _media->regItem(this); } -void HistoryMessage::initDimensions(const HistoryItem *parent) { +void HistoryMessage::initDimensions() { if (justMedia()) { _media->initDimensions(this); _maxw = _media->maxWidth(); @@ -5456,7 +5461,7 @@ void HistoryMessage::setMedia(const MTPMessageMedia *media) { _textWidth = 0; _textHeight = 0; } - initDimensions(0); + initDimensions(); if (App::main()) App::main()->itemResized(this); } @@ -5593,15 +5598,13 @@ void HistoryMessage::drawMessageText(QPainter &p, const QRect &trect, uint32 sel textstyleRestore(); } -int32 HistoryMessage::resize(int32 width, bool dontRecountText, const HistoryItem *parent) { +int32 HistoryMessage::resize(int32 width) { if (width < st::msgMinWidth) return _height; width -= st::msgMargin.left() + st::msgMargin.right(); if (justMedia()) { - _height = _media->resize(width, dontRecountText, this); + _height = _media->resize(width, this); } else { - if (dontRecountText && !_media) return _height; - if (width < st::msgPadding.left() + st::msgPadding.right() + 1) { width = st::msgPadding.left() + st::msgPadding.right() + 1; } else if (width > st::msgMaxWidth) { @@ -5614,10 +5617,10 @@ int32 HistoryMessage::resize(int32 width, bool dontRecountText, const HistoryIte } if (width >= _maxw) { _height = _minh; - if (_media) _media->resize(_maxw - st::msgPadding.left() - st::msgPadding.right(), dontRecountText, this); + if (_media) _media->resize(_maxw - st::msgPadding.left() - st::msgPadding.right(), this); } else { _height = _textHeight; - if (_media && _media->isDisplayed()) _height += st::msgPadding.bottom() + _media->resize(nwidth, dontRecountText, this); + if (_media && _media->isDisplayed()) _height += st::msgPadding.bottom() + _media->resize(nwidth, this); } if (!out() && _history->peer->chat) { _height += st::msgNameFont->height; @@ -5827,8 +5830,8 @@ QString HistoryForwarded::selectedText(uint32 selection) const { return result; } -void HistoryForwarded::initDimensions(const HistoryItem *parent) { - HistoryMessage::initDimensions(parent); +void HistoryForwarded::initDimensions() { + HistoryMessage::initDimensions(); fwdNameUpdated(); } @@ -5871,11 +5874,10 @@ void HistoryForwarded::drawMessageText(QPainter &p, const QRect &trect, uint32 s HistoryMessage::drawMessageText(p, realtrect, selection); } -int32 HistoryForwarded::resize(int32 width, bool dontRecountText, const HistoryItem *parent) { - HistoryMessage::resize(width, dontRecountText, parent); - if (!justMedia() && (_media || !dontRecountText)) { - _height += st::msgServiceNameFont->height; - } +int32 HistoryForwarded::resize(int32 width) { + HistoryMessage::resize(width); + + _height += st::msgServiceNameFont->height; return _height; } @@ -6027,11 +6029,11 @@ QString HistoryReply::selectedText(uint32 selection) const { return result; } -void HistoryReply::initDimensions(const HistoryItem *parent) { +void HistoryReply::initDimensions() { if (!replyToMsg) { _maxReplyWidth = st::msgReplyBarSkip + st::msgDateFont->m.width(lang(replyToMsgId ? lng_profile_loading : lng_deleted_message)) + st::msgPadding.left() + st::msgPadding.right(); } - HistoryMessage::initDimensions(parent); + HistoryMessage::initDimensions(); if (replyToMsg) { replyToNameUpdated(); } else if (!justMedia()) { @@ -6174,11 +6176,10 @@ void HistoryReply::drawMessageText(QPainter &p, const QRect &trect, uint32 selec HistoryMessage::drawMessageText(p, realtrect, selection); } -int32 HistoryReply::resize(int32 width, bool dontRecountText, const HistoryItem *parent) { - HistoryMessage::resize(width, dontRecountText, parent); - if (!justMedia() && (_media || !dontRecountText)) { - _height += st::msgReplyPadding.top() + st::msgReplyBarSize.height() + st::msgReplyPadding.bottom(); - } +int32 HistoryReply::resize(int32 width) { + HistoryMessage::resize(width); + + _height += st::msgReplyPadding.top() + st::msgReplyBarSize.height() + st::msgReplyPadding.bottom(); return _height; } @@ -6405,10 +6406,10 @@ HistoryServiceMsg::HistoryServiceMsg(History *history, HistoryBlock *block, MsgI { } -void HistoryServiceMsg::initDimensions(const HistoryItem *parent) { +void HistoryServiceMsg::initDimensions() { _maxw = _text.maxWidth() + st::msgServicePadding.left() + st::msgServicePadding.right(); _minh = _text.minHeight(); - if (_media) _media->initDimensions(); + if (_media) _media->initDimensions(this); } QString HistoryServiceMsg::selectedText(uint32 selection) const { @@ -6471,9 +6472,7 @@ void HistoryServiceMsg::draw(QPainter &p, uint32 selection) const { textstyleRestore(); } -int32 HistoryServiceMsg::resize(int32 width, bool dontRecountText, const HistoryItem *parent) { - if (dontRecountText) return _height; - +int32 HistoryServiceMsg::resize(int32 width) { 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; @@ -6489,7 +6488,7 @@ int32 HistoryServiceMsg::resize(int32 width, bool dontRecountText, const History } _height += st::msgServicePadding.top() + st::msgServicePadding.bottom() + st::msgServiceMargin.top() + st::msgServiceMargin.bottom(); if (_media) { - _height += st::msgServiceMargin.top() + _media->resize(_media->currentWidth()); + _height += st::msgServiceMargin.top() + _media->resize(_media->currentWidth(), this); } return _height; } @@ -6575,7 +6574,7 @@ HistoryUnreadBar::HistoryUnreadBar(History *history, HistoryBlock *block, int32 initDimensions(); } -void HistoryUnreadBar::initDimensions(const HistoryItem *parent) { +void HistoryUnreadBar::initDimensions() { _maxw = st::msgPadding.left() + st::msgPadding.right() + 1; _minh = st::unreadBarHeight; } @@ -6594,7 +6593,7 @@ void HistoryUnreadBar::draw(QPainter &p, uint32 selection) const { p.drawText(QRect(0, 0, _history->width, st::unreadBarHeight - st::lineWidth), text, style::al_center); } -int32 HistoryUnreadBar::resize(int32 width, bool dontRecountText, const HistoryItem *parent) { +int32 HistoryUnreadBar::resize(int32 width) { _height = st::unreadBarHeight; return _height; } diff --git a/Telegram/SourceFiles/history.h b/Telegram/SourceFiles/history.h index e696535a4..c5f387087 100644 --- a/Telegram/SourceFiles/history.h +++ b/Telegram/SourceFiles/history.h @@ -214,7 +214,7 @@ struct History : public QList { MsgId minMsgId() const; MsgId maxMsgId() const; - int32 geomResize(int32 newWidth, int32 *ytransform = 0, bool dontRecountText = false); // return new size + int32 geomResize(int32 newWidth, int32 *ytransform = 0, HistoryItem *resizedItem = 0); // return new size int32 width, height, msgCount, unreadCount; int32 inboxReadTill, outboxReadTill; HistoryItem *showFrom; @@ -614,7 +614,7 @@ struct HistoryBlock : public QVector { } void removeItem(HistoryItem *item); - int32 geomResize(int32 newWidth, int32 *ytransform, bool dontRecountText); // return new size + int32 geomResize(int32 newWidth, int32 *ytransform, HistoryItem *resizedItem); // return new size int32 y, height; History *history; }; @@ -625,9 +625,6 @@ public: HistoryElem() : _height(0), _maxw(0) { } - virtual void initDimensions(const HistoryItem *parent = 0) = 0; - virtual int32 resize(int32 width, bool dontRecountText = false, const HistoryItem *parent = 0) = 0; // return new height - int32 height() const { return _height; } @@ -683,7 +680,10 @@ public: UnreadBarType }; + virtual void initDimensions() = 0; + virtual int32 resize(int32 width) = 0; // return new height virtual void draw(QPainter &p, uint32 selection) const = 0; + History *history() { return _history; } @@ -869,7 +869,8 @@ public: virtual int32 countHeight(const HistoryItem *parent, int32 width = -1) const { return height(); } - virtual int32 resize(int32 width, bool dontRecountText = false, const HistoryItem *parent = 0) { + virtual void initDimensions(const HistoryItem *parent) = 0; + virtual int32 resize(int32 width, const HistoryItem *parent) { // return new height w = qMin(width, _maxw); return _height; } @@ -924,7 +925,7 @@ public: void initDimensions(const HistoryItem *parent); void draw(QPainter &p, const HistoryItem *parent, bool selected, int32 width = -1) const; - int32 resize(int32 width, bool dontRecountText = false, const HistoryItem *parent = 0); + int32 resize(int32 width, const HistoryItem *parent); HistoryMediaType type() const { return MediaTypePhoto; } @@ -974,7 +975,7 @@ public: void initDimensions(const HistoryItem *parent); void draw(QPainter &p, const HistoryItem *parent, bool selected, int32 width = -1) const; - int32 resize(int32 width, bool dontRecountText = false, const HistoryItem *parent = 0); + int32 resize(int32 width, const HistoryItem *parent); HistoryMediaType type() const { return MediaTypeVideo; } @@ -1054,7 +1055,7 @@ public: void initDimensions(const HistoryItem *parent); void draw(QPainter &p, const HistoryItem *parent, bool selected, int32 width = -1) const; - int32 resize(int32 width, bool dontRecountText = false, const HistoryItem *parent = 0); + int32 resize(int32 width, const HistoryItem *parent); HistoryMediaType type() const { return MediaTypeDocument; } @@ -1105,7 +1106,7 @@ public: void initDimensions(const HistoryItem *parent); void draw(QPainter &p, const HistoryItem *parent, bool selected, int32 width = -1) const; - int32 resize(int32 width, bool dontRecountText = false, const HistoryItem *parent = 0); + int32 resize(int32 width, const HistoryItem *parent); HistoryMediaType type() const { return MediaTypeSticker; } @@ -1170,7 +1171,7 @@ public: bool isDisplayed() const { return !data->pendingTill; } - int32 resize(int32 width, bool dontRecountText = false, const HistoryItem *parent = 0); + int32 resize(int32 width, const HistoryItem *parent); HistoryMediaType type() const { return MediaTypeWebPage; } @@ -1269,7 +1270,7 @@ public: void initDimensions(const HistoryItem *parent); void draw(QPainter &p, const HistoryItem *parent, bool selected, int32 width = -1) const; - int32 resize(int32 width, bool dontRecountText = false, const HistoryItem *parent = 0); + int32 resize(int32 width, const HistoryItem *parent); HistoryMediaType type() const { return MediaTypeImageLink; } @@ -1302,7 +1303,7 @@ public: void initMedia(const MTPMessageMedia *media, QString ¤tText); void initMediaFromText(QString ¤tText); void initMediaFromDocument(DocumentData *doc); - void initDimensions(const HistoryItem *parent = 0); + void initDimensions(); void fromNameUpdated() const; bool justMedia() const { @@ -1314,7 +1315,7 @@ public: void draw(QPainter &p, uint32 selection) const; virtual void drawMessageText(QPainter &p, const QRect &trect, uint32 selection) const; - int32 resize(int32 width, bool dontRecountText = false, const HistoryItem *parent = 0); + int32 resize(int32 width); bool hasPoint(int32 x, int32 y) const; void getState(TextLinkPtr &lnk, HistoryCursorState &state, int32 x, int32 y) const; @@ -1388,13 +1389,13 @@ public: HistoryForwarded(History *history, HistoryBlock *block, const MTPDmessage &msg); HistoryForwarded(History *history, HistoryBlock *block, MsgId id, HistoryMessage *msg); - void initDimensions(const HistoryItem *parent = 0); + void initDimensions(); void fwdNameUpdated() const; void draw(QPainter &p, uint32 selection) const; void drawForwardedFrom(QPainter &p, int32 x, int32 y, int32 w, bool selected) const; void drawMessageText(QPainter &p, const QRect &trect, uint32 selection) const; - int32 resize(int32 width, bool dontRecountText = false, const HistoryItem *parent = 0); + 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; @@ -1432,7 +1433,7 @@ public: HistoryReply(History *history, HistoryBlock *block, const MTPDmessage &msg); HistoryReply(History *history, HistoryBlock *block, MsgId msgId, int32 flags, MsgId replyTo, QDateTime date, int32 from, DocumentData *doc); - void initDimensions(const HistoryItem *parent = 0); + void initDimensions(); bool updateReplyTo(bool force = false); void replyToNameUpdated() const; @@ -1447,7 +1448,7 @@ public: void draw(QPainter &p, uint32 selection) const; void drawReplyTo(QPainter &p, int32 x, int32 y, int32 w, bool selected, bool likeService = false) const; void drawMessageText(QPainter &p, const QRect &trect, uint32 selection) const; - int32 resize(int32 width, bool dontRecountText = false, const HistoryItem *parent = 0); + 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; @@ -1485,10 +1486,10 @@ 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(const HistoryItem *parent = 0); + void initDimensions(); void draw(QPainter &p, uint32 selection) const; - int32 resize(int32 width, bool dontRecountText = false, const HistoryItem *parent = 0); + 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; @@ -1555,12 +1556,12 @@ public: HistoryUnreadBar(History *history, HistoryBlock *block, int32 count, const QDateTime &date); - void initDimensions(const HistoryItem *parent = 0); + void initDimensions(); void setCount(int32 count); void draw(QPainter &p, uint32 selection) const; - int32 resize(int32 width, bool dontRecountText = false, const HistoryItem *parent = 0); + int32 resize(int32 width); void drawInDialog(QPainter &p, const QRect &r, bool act, const HistoryItem *&cacheFor, Text &cache) const; QString notificationText() const; diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index 44b91c51c..a20f9484e 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -1063,7 +1063,7 @@ void HistoryList::keyPressEvent(QKeyEvent *e) { } } -int32 HistoryList::recountHeight(bool dontRecountText) { +int32 HistoryList::recountHeight(HistoryItem *resizedItem) { int32 st = hist->lastScrollTop; int32 ph = scrollArea->height(), minadd = 0; @@ -1073,7 +1073,7 @@ int32 HistoryList::recountHeight(bool dontRecountText) { } if (wasYSkip < minadd) wasYSkip = minadd; - hist->geomResize(scrollArea->width(), &st, dontRecountText); + hist->geomResize(scrollArea->width(), &st, resizedItem); updateBotInfo(false); if (botInfo && !botInfo->text.isEmpty()) { int32 tw = scrollArea->width() - st::msgMargin.left() - st::msgMargin.right(); @@ -4799,7 +4799,7 @@ MsgId HistoryWidget::replyToId() const { void HistoryWidget::updateListSize(int32 addToY, bool initial, bool loadedDown, HistoryItem *resizedItem, bool scrollToIt) { if (!_history || (initial && _histInited) || (!initial && !_histInited)) return; if (_firstLoadRequest) { - if (resizedItem) _list->recountHeight(true); + if (resizedItem) _list->recountHeight(resizedItem); return; // scrollTopMax etc are not working after recountHeight() } @@ -4829,7 +4829,7 @@ void HistoryWidget::updateListSize(int32 addToY, bool initial, bool loadedDown, if (!initial) { _history->lastScrollTop = _scroll.scrollTop(); } - int32 newSt = _list->recountHeight(!!resizedItem); + int32 newSt = _list->recountHeight(resizedItem); bool washidden = _scroll.isHidden(); if (washidden) { _scroll.show(); diff --git a/Telegram/SourceFiles/historywidget.h b/Telegram/SourceFiles/historywidget.h index 4c11b46de..e07f20b9e 100644 --- a/Telegram/SourceFiles/historywidget.h +++ b/Telegram/SourceFiles/historywidget.h @@ -63,7 +63,7 @@ public: void touchScrollUpdated(const QPoint &screenPos); QPoint mapMouseToItem(QPoint p, HistoryItem *item); - int32 recountHeight(bool dontRecountText); + int32 recountHeight(HistoryItem *resizedItem); void updateSize(); void updateMsg(const HistoryItem *msg); diff --git a/Telegram/SourceFiles/mainwidget.cpp b/Telegram/SourceFiles/mainwidget.cpp index 5e4bfd66d..4ab38ccc5 100644 --- a/Telegram/SourceFiles/mainwidget.cpp +++ b/Telegram/SourceFiles/mainwidget.cpp @@ -823,7 +823,7 @@ bool MainWidget::addParticipantFail(UserData *user, const RPCError &error) { } else if (error.type() == "USER_ALREADY_PARTICIPANT" && user->botInfo) { text = lang(lng_bot_already_in_group); } else if (error.type() == "PEER_FLOOD") { - text = lng_cant_invite_not_contact(lt_more_info, QString()); + text = lng_cant_invite_not_contact(lt_more_info, textcmdLink(qsl("https://telegram.org/faq#can-39t-send-messages-to-non-contacts"), lang(lng_cant_more_info))); } App::wnd()->showLayer(new ConfirmBox(text, true)); return false; @@ -900,7 +900,7 @@ bool MainWidget::sendMessageFail(const RPCError &error) { if (mtpIsFlood(error)) return false; if (error.type() == qsl("PEER_FLOOD")) { - App::wnd()->showLayer(new ConfirmBox(lng_cant_send_to_not_contact(lt_more_info, QString()), true)); + App::wnd()->showLayer(new ConfirmBox(lng_cant_send_to_not_contact(lt_more_info, textcmdLink(qsl("https://telegram.org/faq#can-39t-send-messages-to-non-contacts"), lang(lng_cant_more_info))), true)); return true; } return false; @@ -3443,7 +3443,7 @@ void MainWidget::handleUpdates(const MTPUpdates &updates, uint64 randomId) { if (item && ((hasLinks && !item->hasTextLinks()) || (!hasLinks && item->textHasLinks()))) { bool was = item->hasTextLinks(); item->setText(text, d.has_entities() ? linksFromMTP(d.ventities.c_vector().v) : LinksInText()); - item->initDimensions(0); + item->initDimensions(); itemResized(item); if (!was && item->hasTextLinks()) { item->history()->addToOverview(item, OverviewLinks); diff --git a/Telegram/SourceFiles/mtproto/scheme.tl b/Telegram/SourceFiles/mtproto/scheme.tl index c6e55ae2c..78c229cc0 100644 --- a/Telegram/SourceFiles/mtproto/scheme.tl +++ b/Telegram/SourceFiles/mtproto/scheme.tl @@ -126,7 +126,6 @@ register.saveDeveloperInfo#9a5f6e95 name:string email:string phone_number:string ---types--- - error#c4b9f9bb code:int text:string = Error; null#56730bcc = Null; From 96e69c091f8f9a3f347e8e95e7fb14ef75a65bd9 Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 10 Sep 2015 14:20:28 +0300 Subject: [PATCH 11/17] custom links support done --- Telegram/Resources/lang.strings | 3 +++ Telegram/SourceFiles/boxes/confirmbox.cpp | 17 ++++++++++++-- Telegram/SourceFiles/boxes/confirmbox.h | 17 ++++++++++++++ Telegram/SourceFiles/gui/text.cpp | 27 +++++++++++++++++++---- Telegram/SourceFiles/gui/text.h | 9 ++++++++ 5 files changed, 67 insertions(+), 6 deletions(-) diff --git a/Telegram/Resources/lang.strings b/Telegram/Resources/lang.strings index 4d0f0cce7..9a0044291 100644 --- a/Telegram/Resources/lang.strings +++ b/Telegram/Resources/lang.strings @@ -502,6 +502,9 @@ Copyright (c) 2014 John Preston, https://desktop.telegram.org "lng_bot_description" = "What can this bot do?"; "lng_unblock_button" = "Unblock"; +"lng_open_this_link" = "Open this link?"; +"lng_open_link" = "Open"; + "lng_bot_start" = "Start"; "lng_bot_choose_group" = "Choose Group"; "lng_bot_no_groups" = "You have no groups"; diff --git a/Telegram/SourceFiles/boxes/confirmbox.cpp b/Telegram/SourceFiles/boxes/confirmbox.cpp index bd4ed0d01..c601cfa97 100644 --- a/Telegram/SourceFiles/boxes/confirmbox.cpp +++ b/Telegram/SourceFiles/boxes/confirmbox.cpp @@ -49,7 +49,7 @@ void ConfirmBox::init(const QString &text) { _text.setText(st::boxFont, text, (_infoMsg ? _confirmBoxTextOptions : _textPlainOptions)); _textWidth = st::boxWidth - st::boxPadding.left() - st::boxPadding.right(); - _textHeight = _text.countHeight(_textWidth); + _textHeight = qMin(_text.countHeight(_textWidth), 16 * st::boxFont->height); setMaxHeight(st::boxPadding.top() + _textHeight + st::boxPadding.bottom() + (_infoMsg ? _close.height() : _confirm.height())); if (_infoMsg) { @@ -171,7 +171,7 @@ void ConfirmBox::paintEvent(QPaintEvent *e) { // draw box title / text p.setFont(st::boxFont->f); p.setPen(st::black->p); - _text.draw(p, st::boxPadding.left(), st::boxPadding.top(), _textWidth, (_text.maxWidth() < width()) ? style::al_center : style::al_left); + _text.drawElided(p, st::boxPadding.left(), st::boxPadding.top(), _textWidth, 16, (_text.maxWidth() < width()) ? style::al_center : style::al_left); } void ConfirmBox::resizeEvent(QResizeEvent *e) { @@ -182,3 +182,16 @@ void ConfirmBox::resizeEvent(QResizeEvent *e) { _cancel.move(0, st::boxPadding.top() + _textHeight + st::boxPadding.bottom()); } } + +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())); +} + +void ConfirmLinkBox::onOpenLink() { + if (reMailStart().match(_url).hasMatch()) { + EmailLink(_url).onClick(Qt::LeftButton); + } else { + TextLink(_url).onClick(Qt::LeftButton); + } + App::wnd()->hideLayer(); +} diff --git a/Telegram/SourceFiles/boxes/confirmbox.h b/Telegram/SourceFiles/boxes/confirmbox.h index 1a54c33ac..101e27d3c 100644 --- a/Telegram/SourceFiles/boxes/confirmbox.h +++ b/Telegram/SourceFiles/boxes/confirmbox.h @@ -67,3 +67,20 @@ private: QPoint _lastMousePos; TextLinkPtr _myLink; }; + +class ConfirmLinkBox : public ConfirmBox { + Q_OBJECT + +public: + + ConfirmLinkBox(const QString &url); + +public slots: + + void onOpenLink(); + +private: + + QString _url; + +}; diff --git a/Telegram/SourceFiles/gui/text.cpp b/Telegram/SourceFiles/gui/text.cpp index 83f24fb4c..cb7717a54 100644 --- a/Telegram/SourceFiles/gui/text.cpp +++ b/Telegram/SourceFiles/gui/text.cpp @@ -21,6 +21,8 @@ Copyright (c) 2014 John Preston, https://desktop.telegram.org #include "lang.h" #include "pspecific.h" +#include "boxes/confirmbox.h" +#include "window.h" #include @@ -60,6 +62,10 @@ const QRegularExpression &reMailName() { return _reMailName; } +const QRegularExpression &reMailStart() { + return _reMailStart; +} + const QRegularExpression &reHashtag() { return _reHashtag; } @@ -336,9 +342,16 @@ public: createBlock(); - QString lnkUrl = QString(start + waitingLink->offset, waitingLink->length), lnkText; int32 fullDisplayed; - getLinkData(lnkUrl, lnkText, fullDisplayed); + QString lnkUrl, lnkText; + if (waitingLink->type == LinkInTextCustomUrl) { + lnkUrl = waitingLink->text; + lnkText = QString(start + waitingLink->offset, waitingLink->length); + fullDisplayed = -5; + } else { + lnkUrl = QString(start + waitingLink->offset, waitingLink->length); + getLinkData(lnkUrl, lnkText, fullDisplayed); + } links.push_back(TextLinkData(lnkUrl, fullDisplayed)); lnkIndex = 0x8000 + links.size(); @@ -617,7 +630,9 @@ public: _t->_links.resize(lnkIndex); const TextLinkData &data(links[lnkIndex - maxLnkIndex - 1]); TextLinkPtr lnk; - if (data.fullDisplayed < -3) { // bot command + if (data.fullDisplayed < -4) { // hidden link + lnk = TextLinkPtr(new CustomTextLink(data.url)); + } else if (data.fullDisplayed < -3) { // bot command lnk = TextLinkPtr(new BotCommandLink(data.url)); } else if (data.fullDisplayed < -2) { // mention if (options.flags & TextTwitterMentions) { @@ -664,7 +679,7 @@ private: TextLinkData(const QString &url = QString(), int32 fullDisplayed = 1) : url(url), fullDisplayed(fullDisplayed) { } QString url; - int32 fullDisplayed; // -4 - bot command, -3 - mention, -2 - hashtag, -1 - email + int32 fullDisplayed; // -5 - custom text link, -4 - bot command, -3 - mention, -2 - hashtag, -1 - email }; typedef QVector TextLinks; TextLinks links; @@ -820,6 +835,10 @@ void EmailLink::onClick(Qt::MouseButton button) const { } } +void CustomTextLink::onClick(Qt::MouseButton button) const { + App::wnd()->showLayer(new ConfirmLinkBox(text())); +} + void MentionLink::onClick(Qt::MouseButton button) const { if (button == Qt::LeftButton || button == Qt::MiddleButton) { App::openUserByName(_tag.mid(1), true); diff --git a/Telegram/SourceFiles/gui/text.h b/Telegram/SourceFiles/gui/text.h index bfc3749f0..77342dba6 100644 --- a/Telegram/SourceFiles/gui/text.h +++ b/Telegram/SourceFiles/gui/text.h @@ -357,6 +357,14 @@ private: }; +class CustomTextLink : public TextLink { +public: + + CustomTextLink(const QString &url) : TextLink(url, false) { + } + void onClick(Qt::MouseButton button) const; +}; + class EmailLink : public ITextLink { TEXT_LINK_CLASS(EmailLink) @@ -603,6 +611,7 @@ const QSet &validProtocols(); const QSet &validTopDomains(); const QRegularExpression &reDomain(); const QRegularExpression &reMailName(); +const QRegularExpression &reMailStart(); const QRegularExpression &reHashtag(); const QRegularExpression &reBotCommand(); From ee8ddd3714725fd20252e5c3490b15f40630340c Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 10 Sep 2015 14:22:18 +0300 Subject: [PATCH 12/17] langs updated --- Telegram/SourceFiles/langs/lang_de.strings | 9 ++++++++- Telegram/SourceFiles/langs/lang_es.strings | 11 +++++++++-- Telegram/SourceFiles/langs/lang_it.strings | 11 +++++++++-- Telegram/SourceFiles/langs/lang_ko.strings | 9 ++++++++- Telegram/SourceFiles/langs/lang_nl.strings | 9 ++++++++- Telegram/SourceFiles/langs/lang_pt_BR.strings | 11 +++++++++-- 6 files changed, 51 insertions(+), 9 deletions(-) diff --git a/Telegram/SourceFiles/langs/lang_de.strings b/Telegram/SourceFiles/langs/lang_de.strings index 2bfd27567..a5c208da7 100644 --- a/Telegram/SourceFiles/langs/lang_de.strings +++ b/Telegram/SourceFiles/langs/lang_de.strings @@ -485,6 +485,13 @@ Copyright (c) 2014 John Preston, https://desktop.telegram.org "lng_in_dlg_sticker" = "Sticker"; "lng_in_dlg_sticker_emoji" = "{emoji} (Sticker)"; +"lng_report_spam" = "Spam melden"; +"lng_report_spam_hide" = "Schließen"; +"lng_report_spam_thanks" = "Danke für die Meldung!"; +"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_more_info" = "Weitere Infos »"; + "lng_send_button" = "Senden"; "lng_message_ph" = "Schreibe deine Nachricht.."; "lng_record_cancel" = "Zum Abbrechen rausbewegen"; @@ -648,7 +655,7 @@ Copyright (c) 2014 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" = "— Stummgeschaltete Chats können ab sofort optional mitgezählt werden (Einstellungen > Stummgeschaltete Chats mitzählen)\n— Übersicht der im Chat geteilten Links im Bereich 'Geteilte Medien'\n— GIF-Vorschau und PDF-Vorschau von Direktlinks (.pdf und .gif)"; +"lng_new_version_text" = "— Unerwünschte Nachrichten (Spam) in neuen Chats melden\n— Sonstige Fehlerbehungen und Verbesserungen\n— OS X 10.8 Benachrichtigungen funktionieren wieder"; "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 47e93f526..d3ead3e43 100644 --- a/Telegram/SourceFiles/langs/lang_es.strings +++ b/Telegram/SourceFiles/langs/lang_es.strings @@ -457,7 +457,7 @@ Copyright (c) 2014 John Preston, https://desktop.telegram.org "lng_media_video" = "Vídeo"; "lng_media_audio" = "Mensaje de voz"; -"lng_emoji_category0" = "Usados con frecuencia"; +"lng_emoji_category0" = "Uso frecuente"; "lng_emoji_category1" = "Personas"; "lng_emoji_category2" = "Naturaleza"; "lng_emoji_category3" = "Comida y bebida"; @@ -485,6 +485,13 @@ Copyright (c) 2014 John Preston, https://desktop.telegram.org "lng_in_dlg_sticker" = "Sticker"; "lng_in_dlg_sticker_emoji" = "{emoji} (sticker)"; +"lng_report_spam" = "Reportar spam"; +"lng_report_spam_hide" = "Ocultar"; +"lng_report_spam_thanks" = "¡Gracias por tu reporte!"; +"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_more_info" = "Más información »"; + "lng_send_button" = "Enviar"; "lng_message_ph" = "Escribir un mensaje..."; "lng_record_cancel" = "Suelta fuera de aquí para cancelar"; @@ -648,7 +655,7 @@ Copyright (c) 2014 John Preston, https://desktop.telegram.org "lng_new_version_wrap" = "Telegram Desktop fue 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" = "— Incluye los chats silenciados en el conteo de 'no leídos', en Ajustes\n— Vista y búsqueda de los enlaces compartidos, en 'Todos los archivos'\n— Vista previa al enviar enlaces a GIF animados o archivos PDF"; +"lng_new_version_text" = "— Botones para reportar spam en los nuevos chats\n— Otras mejoras y correcciones\n— Notificaciones en OS X 10.8 arregladas"; "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 dfa4eff43..08e1fc48e 100644 --- a/Telegram/SourceFiles/langs/lang_it.strings +++ b/Telegram/SourceFiles/langs/lang_it.strings @@ -403,7 +403,7 @@ Copyright (c) 2014 John Preston, https://desktop.telegram.org "lng_create_group_title" = "Nuovo gruppo"; "lng_failed_add_participant" = "Impossibile aggiungere l'utente. Riprova più tardi."; -"lng_failed_add_not_mutual" = "Se una persona lascia un gruppo, solo\nun contatto in comune può reinvitarla\n(chi ti invita deve avere il tuo\ncontatto su Telegram, e viceversa)."; +"lng_failed_add_not_mutual" = "Spiacenti, se una persona lascia un gruppo,\nsolo un contatto in comune può reinvitarla\n(chi ti invita deve avere il tuo\ncontatto su Telegram, 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."; @@ -485,6 +485,13 @@ Copyright (c) 2014 John Preston, https://desktop.telegram.org "lng_in_dlg_sticker" = "Sticker"; "lng_in_dlg_sticker_emoji" = "{emoji} (sticker)"; +"lng_report_spam" = "Segnala spam"; +"lng_report_spam_hide" = "Nascondi"; +"lng_report_spam_thanks" = "Grazie per la tua segnalazione!"; +"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 a contatti in comune. {more_info}"; +"lng_cant_more_info" = "Più info »"; + "lng_send_button" = "Invia"; "lng_message_ph" = "Scrivi un messaggio.."; "lng_record_cancel" = "Rilascia fuori da qui per annullare"; @@ -648,7 +655,7 @@ Copyright (c) 2014 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" = "— Includi chat silenziate nel badge nelle Impostazioni\n— Panoramica dei link condivisi e ricerca nei media condivisi\n— Anteprima quando invii una GIF o un file PDF."; +"lng_new_version_text" = "— Pulsante per segnalare lo spam nelle nuove chat\n— Altri fix e miglioramenti\n— Risoluzione problema alle notifiche in OS X 10.8"; "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 b6c0f4df1..06b7ab764 100644 --- a/Telegram/SourceFiles/langs/lang_ko.strings +++ b/Telegram/SourceFiles/langs/lang_ko.strings @@ -485,6 +485,13 @@ Copyright (c) 2014 John Preston, https://desktop.telegram.org "lng_in_dlg_sticker" = "스티커"; "lng_in_dlg_sticker_emoji" = "{emoji} (스티커)"; +"lng_report_spam" = "스팸 신고"; +"lng_report_spam_hide" = "숨기기"; +"lng_report_spam_thanks" = "신고해주셔서 감사합니다!"; +"lng_cant_send_to_not_contact" = "죄송하지만, 현재 서로 연락처가 추가된\n회원들끼리만 전송이 가능합니다. {more_info}"; +"lng_cant_invite_not_contact" = "죄송하지만, 현재 서로 연락처가 추가된\n회원들끼리만 추가 가능합니다. {more_info}"; +"lng_cant_more_info" = "자세한 정보 »"; + "lng_send_button" = "보내기"; "lng_message_ph" = "메시지 쓰기"; "lng_record_cancel" = "이 영역 밖에서 마우스 클릭을 해제하시면 취소가 됩니다."; @@ -648,7 +655,7 @@ Copyright (c) 2014 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— GIF 링크 및 PDF 파일 전송시 프리뷰 기능"; +"lng_new_version_text" = "— 스팸 신고 버튼 추가\n— 기타 오류 수정 및 기능 향상\n— OS X 10.8 알림 수정"; "lng_menu_insert_unicode" = "유니코드 문자를 입력하세요."; diff --git a/Telegram/SourceFiles/langs/lang_nl.strings b/Telegram/SourceFiles/langs/lang_nl.strings index 966775c7f..5d7a27e0b 100644 --- a/Telegram/SourceFiles/langs/lang_nl.strings +++ b/Telegram/SourceFiles/langs/lang_nl.strings @@ -485,6 +485,13 @@ Copyright (c) 2014 John Preston, https://desktop.telegram.org "lng_in_dlg_sticker" = "Sticker"; "lng_in_dlg_sticker_emoji" = "{emoji} (sticker)"; +"lng_report_spam" = "Spam melden"; +"lng_report_spam_hide" = "Verbergen"; +"lng_report_spam_thanks" = "Bedankt voor je melding!"; +"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_more_info" = "Meer informatie »"; + "lng_send_button" = "Stuur"; "lng_message_ph" = "Bericht schrijven"; "lng_record_cancel" = "Annuleren: uit het vak loslaten"; @@ -648,7 +655,7 @@ Copyright (c) 2014 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" = "— Stille chats meetellen in ongelezen teller via instellingen\n— Gedeelde links-overzicht en zoeken in gedeelde media\n— Voorvertoning voor links naar GIF-animaties en PDF-bestanden"; +"lng_new_version_text" = "— 'Spam melden'-optie in nieuwe chats\n— Probleemoplossing en kleine verbeteringen\n— Problemen met OS X 10.8 berichtmeldingen 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 b41698cc4..9bc6b790e 100644 --- a/Telegram/SourceFiles/langs/lang_pt_BR.strings +++ b/Telegram/SourceFiles/langs/lang_pt_BR.strings @@ -454,7 +454,7 @@ Copyright (c) 2014 John Preston, https://desktop.telegram.org "lng_media_open_with" = "Abrir Com"; "lng_media_download" = "Download"; "lng_media_cancel" = "Cancelar"; -"lng_media_video" = "Vídeos"; +"lng_media_video" = "Vídeo"; "lng_media_audio" = "Mensagem de voz"; "lng_emoji_category0" = "Frequentemente usado"; @@ -485,6 +485,13 @@ Copyright (c) 2014 John Preston, https://desktop.telegram.org "lng_in_dlg_sticker" = "Sticker"; "lng_in_dlg_sticker_emoji" = "{emoji} (sticker)"; +"lng_report_spam" = "Reportar Spam"; +"lng_report_spam_hide" = "Ocultar"; +"lng_report_spam_thanks" = "Obrigado por 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_more_info" = "Informações »"; + "lng_send_button" = "Enviar"; "lng_message_ph" = "Escrever a mensagem.."; "lng_record_cancel" = "Solte fora desse campo para cancelar"; @@ -648,7 +655,7 @@ Copyright (c) 2014 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 menores melhorias"; -"lng_new_version_text" = "— Incluir chats silenciados no contador de notificações em Configurações\n— Visão geral dos links compartilhados e busca nas mídias compartilhadas\n— Pré-visualização em links com GIF e arquivos em PDF"; +"lng_new_version_text" = "— Botões para reportar spam em novos chats\n— Outras melhorias e resoluções de erros\n— OS X 10.8 problemas com notificações solucionadas"; "lng_menu_insert_unicode" = "Inserir caractere de controle Unicode"; From 1dfe3a60c49f59bc657586f932eac5d3138db9ad Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 10 Sep 2015 16:13:53 +0300 Subject: [PATCH 13/17] langs updated --- 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 +++ 6 files changed, 18 insertions(+) diff --git a/Telegram/SourceFiles/langs/lang_de.strings b/Telegram/SourceFiles/langs/lang_de.strings index a5c208da7..44360ddbc 100644 --- a/Telegram/SourceFiles/langs/lang_de.strings +++ b/Telegram/SourceFiles/langs/lang_de.strings @@ -502,6 +502,9 @@ Copyright (c) 2014 John Preston, https://desktop.telegram.org "lng_bot_description" = "Was kann dieser Bot?"; "lng_unblock_button" = "Freigeben"; +"lng_open_this_link" = "Diesen Link öffnen?"; +"lng_open_link" = "Öffnen"; + "lng_bot_start" = "Starten"; "lng_bot_choose_group" = "Gruppe auswählen"; "lng_bot_no_groups" = "Du hast keine Gruppen"; diff --git a/Telegram/SourceFiles/langs/lang_es.strings b/Telegram/SourceFiles/langs/lang_es.strings index d3ead3e43..73e7a462b 100644 --- a/Telegram/SourceFiles/langs/lang_es.strings +++ b/Telegram/SourceFiles/langs/lang_es.strings @@ -502,6 +502,9 @@ Copyright (c) 2014 John Preston, https://desktop.telegram.org "lng_bot_description" = "¿Qué puede hacer este bot?"; "lng_unblock_button" = "Desbloquear"; +"lng_open_this_link" = "¿Abrir este enlace?"; +"lng_open_link" = "Abrir"; + "lng_bot_start" = "Iniciar"; "lng_bot_choose_group" = "Elegir grupo"; "lng_bot_no_groups" = "No tienes grupos"; diff --git a/Telegram/SourceFiles/langs/lang_it.strings b/Telegram/SourceFiles/langs/lang_it.strings index 08e1fc48e..712aeb38f 100644 --- a/Telegram/SourceFiles/langs/lang_it.strings +++ b/Telegram/SourceFiles/langs/lang_it.strings @@ -502,6 +502,9 @@ Copyright (c) 2014 John Preston, https://desktop.telegram.org "lng_bot_description" = "Cosa può fare questo bot?"; "lng_unblock_button" = "Sblocca"; +"lng_open_this_link" = "Aprire questo link?"; +"lng_open_link" = "Apri"; + "lng_bot_start" = "Avvia"; "lng_bot_choose_group" = "Scegli gruppo"; "lng_bot_no_groups" = "Non hai gruppi"; diff --git a/Telegram/SourceFiles/langs/lang_ko.strings b/Telegram/SourceFiles/langs/lang_ko.strings index 06b7ab764..b8bfde487 100644 --- a/Telegram/SourceFiles/langs/lang_ko.strings +++ b/Telegram/SourceFiles/langs/lang_ko.strings @@ -502,6 +502,9 @@ Copyright (c) 2014 John Preston, https://desktop.telegram.org "lng_bot_description" = "봇이 할 수 있는 일은 무엇일까요?"; "lng_unblock_button" = "차단해제"; +"lng_open_this_link" = "이 링크로 이동하시겠나요?"; +"lng_open_link" = "열기"; + "lng_bot_start" = "시작"; "lng_bot_choose_group" = "그룹 선택"; "lng_bot_no_groups" = "그룹이 존재하지 않습니다."; diff --git a/Telegram/SourceFiles/langs/lang_nl.strings b/Telegram/SourceFiles/langs/lang_nl.strings index 5d7a27e0b..16703c5d9 100644 --- a/Telegram/SourceFiles/langs/lang_nl.strings +++ b/Telegram/SourceFiles/langs/lang_nl.strings @@ -502,6 +502,9 @@ Copyright (c) 2014 John Preston, https://desktop.telegram.org "lng_bot_description" = "Wat kan deze bot? "; "lng_unblock_button" = "Deblokkeer"; +"lng_open_this_link" = "Link openen?"; +"lng_open_link" = "Openen"; + "lng_bot_start" = "Begin"; "lng_bot_choose_group" = "Groep kiezen"; "lng_bot_no_groups" = "Je hebt geen groepen"; diff --git a/Telegram/SourceFiles/langs/lang_pt_BR.strings b/Telegram/SourceFiles/langs/lang_pt_BR.strings index 9bc6b790e..84b3bd4c3 100644 --- a/Telegram/SourceFiles/langs/lang_pt_BR.strings +++ b/Telegram/SourceFiles/langs/lang_pt_BR.strings @@ -502,6 +502,9 @@ Copyright (c) 2014 John Preston, https://desktop.telegram.org "lng_bot_description" = "O que esse bot pode fazer?"; "lng_unblock_button" = "Desbloquear"; +"lng_open_this_link" = "Abrir este link?"; +"lng_open_link" = "Abrir"; + "lng_bot_start" = "Iniciar"; "lng_bot_choose_group" = "Escolher Grupo"; "lng_bot_no_groups" = "Você não possui grupos"; From 825567a44f4bb9f3c8c0f9b707d653773a4aa493 Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 10 Sep 2015 16:20:22 +0300 Subject: [PATCH 14/17] version 0.8.56 stable prepared --- Telegram/PrepareWin.bat | 8 ++++---- Telegram/SourceFiles/application.cpp | 4 +++- Telegram/SourceFiles/boxes/contactsbox.cpp | 2 +- Telegram/SourceFiles/config.h | 4 ++-- Telegram/SourceFiles/mainwidget.cpp | 4 ++-- Telegram/Telegram.plist | 2 +- Telegram/Telegram.rc | Bin 5540 -> 5540 bytes Telegram/Telegram.xcodeproj/project.pbxproj | 12 ++++++------ Telegram/Version.sh | 2 +- 9 files changed, 20 insertions(+), 18 deletions(-) diff --git a/Telegram/PrepareWin.bat b/Telegram/PrepareWin.bat index 7fec83b31..c832556d5 100644 --- a/Telegram/PrepareWin.bat +++ b/Telegram/PrepareWin.bat @@ -1,10 +1,10 @@ @echo OFF set "AppVersionStrMajor=0.8" -set "AppVersion=8055" -set "AppVersionStrSmall=0.8.55" -set "AppVersionStr=0.8.55" -set "AppVersionStrFull=0.8.55.0" +set "AppVersion=8056" +set "AppVersionStrSmall=0.8.56" +set "AppVersionStr=0.8.56" +set "AppVersionStrFull=0.8.56.0" set "DevChannel=0" if %DevChannel% neq 0 goto preparedev diff --git a/Telegram/SourceFiles/application.cpp b/Telegram/SourceFiles/application.cpp index efb917d1d..fab0f4b15 100644 --- a/Telegram/SourceFiles/application.cpp +++ b/Telegram/SourceFiles/application.cpp @@ -675,8 +675,10 @@ void Application::checkMapVersion() { QString versionFeatures; if (cDevVersion() && Local::oldMapVersion() < 8054) { versionFeatures = QString::fromUtf8("\xe2\x80\x94 Preview when sending links to GIF animations and PDF files\n\xe2\x80\x94 Full date and time shown when mouse over message timestamp");// .replace('@', qsl("@") + QChar(0x200D)); - } else if (!cDevVersion() && Local::oldMapVersion() < 8055) { + } else if (Local::oldMapVersion() < 8056) { versionFeatures = lang(lng_new_version_text).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")); diff --git a/Telegram/SourceFiles/boxes/contactsbox.cpp b/Telegram/SourceFiles/boxes/contactsbox.cpp index e11a996e2..c3450fd9b 100644 --- a/Telegram/SourceFiles/boxes/contactsbox.cpp +++ b/Telegram/SourceFiles/boxes/contactsbox.cpp @@ -1293,7 +1293,7 @@ bool CreateGroupBox::failed(const RPCError &error) { return true; } else if (error.type() == "PEER_FLOOD") { emit closed(); - App::wnd()->showLayer(new ConfirmBox(lng_cant_invite_not_contact(lt_more_info, textcmdLink(qsl("https://telegram.org/faq#can-39t-send-messages-to-non-contacts"), lang(lng_cant_more_info)))), true); + App::wnd()->showLayer(new ConfirmBox(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)))), true); return true; } return false; diff --git a/Telegram/SourceFiles/config.h b/Telegram/SourceFiles/config.h index fb3462f1c..3c7294a13 100644 --- a/Telegram/SourceFiles/config.h +++ b/Telegram/SourceFiles/config.h @@ -17,8 +17,8 @@ Copyright (c) 2014 John Preston, https://desktop.telegram.org */ #pragma once -static const int32 AppVersion = 8055; -static const wchar_t *AppVersionStr = L"0.8.55"; +static const int32 AppVersion = 8056; +static const wchar_t *AppVersionStr = L"0.8.56"; static const bool DevVersion = false; static const wchar_t *AppNameOld = L"Telegram Win (Unofficial)"; diff --git a/Telegram/SourceFiles/mainwidget.cpp b/Telegram/SourceFiles/mainwidget.cpp index 4ab38ccc5..d86f4a7b8 100644 --- a/Telegram/SourceFiles/mainwidget.cpp +++ b/Telegram/SourceFiles/mainwidget.cpp @@ -823,7 +823,7 @@ bool MainWidget::addParticipantFail(UserData *user, const RPCError &error) { } else if (error.type() == "USER_ALREADY_PARTICIPANT" && user->botInfo) { text = lang(lng_bot_already_in_group); } else if (error.type() == "PEER_FLOOD") { - text = lng_cant_invite_not_contact(lt_more_info, textcmdLink(qsl("https://telegram.org/faq#can-39t-send-messages-to-non-contacts"), lang(lng_cant_more_info))); + text = 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))); } App::wnd()->showLayer(new ConfirmBox(text, true)); return false; @@ -900,7 +900,7 @@ bool MainWidget::sendMessageFail(const RPCError &error) { if (mtpIsFlood(error)) return false; if (error.type() == qsl("PEER_FLOOD")) { - App::wnd()->showLayer(new ConfirmBox(lng_cant_send_to_not_contact(lt_more_info, textcmdLink(qsl("https://telegram.org/faq#can-39t-send-messages-to-non-contacts"), lang(lng_cant_more_info))), true)); + App::wnd()->showLayer(new ConfirmBox(lng_cant_send_to_not_contact(lt_more_info, textcmdLink(qsl("https://telegram.org/faq?_hash=can-39t-send-messages-to-non-contacts"), lang(lng_cant_more_info))), true)); return true; } return false; diff --git a/Telegram/Telegram.plist b/Telegram/Telegram.plist index d2f122b3b..529320931 100644 --- a/Telegram/Telegram.plist +++ b/Telegram/Telegram.plist @@ -11,7 +11,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 0.8.55 + 0.8.56 LSMinimumSystemVersion $(MACOSX_DEPLOYMENT_TARGET) CFBundleSignature diff --git a/Telegram/Telegram.rc b/Telegram/Telegram.rc index 1bef961840c268f34f034910d1fefc7a0e9930ff..ec03f392f3bfad7cf4eecd426c0d2c4658079cd6 100644 GIT binary patch delta 53 zcmZ3Yy+nIM5ig_J Date: Thu, 10 Sep 2015 16:29:37 +0300 Subject: [PATCH 15/17] os x and linux warning fixed in 0.8.56, win version uses prev commit --- Telegram/SourceFiles/historywidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index a20f9484e..2d2190d40 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -2979,7 +2979,7 @@ void HistoryWidget::updateReportSpamStatus() { return; } } - if ((!_history->loadedAtTop() && (_history->size() < 2 || _history->size() == 2 && _history->at(1)->size() < 2)) || !cContactsReceived() || _firstLoadRequest) { + if ((!_history->loadedAtTop() && (_history->size() < 2 || (_history->size() == 2 && _history->at(1)->size() < 2))) || !cContactsReceived() || _firstLoadRequest) { _reportSpamStatus = dbiprsUnknown; } else if (_peer->chat) { if (_peer->asChat()->inviterForSpamReport > 0) { From dbbf360e329121a054592d7183bd396a0d59c198 Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 10 Sep 2015 16:40:29 +0300 Subject: [PATCH 16/17] fixed report button in 0.8.56 stable version --- Telegram/SourceFiles/historywidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index a20f9484e..3e5542f4e 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -2968,7 +2968,7 @@ void HistoryWidget::contactsReceived() { } void HistoryWidget::updateReportSpamStatus() { - if (!_peer || App::userFromPeer(_peer->id) == MTP::authedId()) { + if (!_peer || !_peer->chat && (App::userFromPeer(_peer->id) == MTP::authedId() || isNotificationsUser(_peer->id) || isServiceUser(_peer->id))) { _reportSpamStatus = dbiprsNoButton; return; } else { From 8f0606c9b6dc49447bbeec8018b7d418fcd102f4 Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 10 Sep 2015 16:43:46 +0300 Subject: [PATCH 17/17] fixed warning in os x and linux, 0.8.56 stable version --- Telegram/SourceFiles/historywidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index b6e3fafa0..28ed1b902 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -2968,7 +2968,7 @@ void HistoryWidget::contactsReceived() { } void HistoryWidget::updateReportSpamStatus() { - if (!_peer || !_peer->chat && (App::userFromPeer(_peer->id) == MTP::authedId() || isNotificationsUser(_peer->id) || isServiceUser(_peer->id))) { + if (!_peer || (!_peer->chat && (App::userFromPeer(_peer->id) == MTP::authedId() || isNotificationsUser(_peer->id) || isServiceUser(_peer->id)))) { _reportSpamStatus = dbiprsNoButton; return; } else {