From cfe12f773fa6b5a6618516e95a9b147c40e68eca Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 18 Nov 2019 12:28:14 +0300 Subject: [PATCH] Move some modules to lib_mtproto. --- Telegram/SourceFiles/boxes/calendar_box.cpp | 2 +- Telegram/SourceFiles/boxes/confirm_box.h | 2 +- .../SourceFiles/boxes/confirm_phone_box.h | 2 +- Telegram/SourceFiles/boxes/edit_caption_box.h | 2 +- Telegram/SourceFiles/boxes/report_box.h | 2 +- Telegram/SourceFiles/boxes/share_box.h | 2 +- Telegram/SourceFiles/boxes/username_box.h | 2 +- Telegram/SourceFiles/calls/calls_call.h | 2 +- Telegram/SourceFiles/core/application.h | 2 +- Telegram/SourceFiles/core/utils.cpp | 14 --- Telegram/SourceFiles/core/utils.h | 4 - .../dialogs/dialogs_inner_widget.h | 2 +- Telegram/SourceFiles/dialogs/dialogs_widget.h | 2 +- .../SourceFiles/export/export_api_wrap.cpp | 2 +- .../SourceFiles/export/export_controller.h | 5 +- Telegram/SourceFiles/main/main_account.h | 2 +- Telegram/SourceFiles/mainwidget.h | 2 +- .../SourceFiles/mtproto/concurrent_sender.cpp | 4 +- Telegram/SourceFiles/mtproto/config_loader.h | 2 +- Telegram/SourceFiles/mtproto/connection.cpp | 4 +- Telegram/SourceFiles/mtproto/connection.h | 2 +- .../mtproto/connection_resolving.h | 2 +- .../SourceFiles/mtproto/connection_tcp.cpp | 2 +- Telegram/SourceFiles/mtproto/connection_tcp.h | 2 +- Telegram/SourceFiles/mtproto/dc_options.h | 2 +- Telegram/SourceFiles/mtproto/dcenter.cpp | 2 +- .../mtproto/details/mtproto_dc_key_checker.h | 2 +- .../mtproto/details/mtproto_dc_key_creator.h | 2 +- Telegram/SourceFiles/mtproto/mtp_instance.cpp | 16 +++- Telegram/SourceFiles/mtproto/mtp_instance.h | 12 ++- ...socket.cpp => mtproto_abstract_socket.cpp} | 6 +- ...act_socket.h => mtproto_abstract_socket.h} | 0 .../{auth_key.cpp => mtproto_auth_key.cpp} | 95 ++++++++++--------- .../{auth_key.h => mtproto_auth_key.h} | 0 .../mtproto/{mtp_pch.cpp => mtproto_pch.cpp} | 2 +- .../mtproto/{mtp_pch.h => mtproto_pch.h} | 0 ...{rpc_sender.cpp => mtproto_rpc_sender.cpp} | 13 ++- .../{rpc_sender.h => mtproto_rpc_sender.h} | 2 - ...lic_key.cpp => mtproto_rsa_public_key.cpp} | 14 +-- ..._public_key.h => mtproto_rsa_public_key.h} | 0 ..._tcp_socket.cpp => mtproto_tcp_socket.cpp} | 2 +- ...{mtp_tcp_socket.h => mtproto_tcp_socket.h} | 2 +- ..._tls_socket.cpp => mtproto_tls_socket.cpp} | 4 +- ...{mtp_tls_socket.h => mtproto_tls_socket.h} | 2 +- Telegram/SourceFiles/mtproto/sender.h | 2 +- Telegram/SourceFiles/mtproto/session.cpp | 2 +- Telegram/SourceFiles/mtproto/session.h | 2 +- .../mtproto/special_config_request.cpp | 4 +- .../passport/passport_encryption.cpp | 2 +- .../SourceFiles/storage/serialize_common.h | 2 +- Telegram/gyp/lib_mtproto.gyp | 22 +++-- Telegram/gyp/telegram/sources.txt | 6 -- Telegram/lib_base | 2 +- 53 files changed, 143 insertions(+), 148 deletions(-) rename Telegram/SourceFiles/mtproto/{mtp_abstract_socket.cpp => mtproto_abstract_socket.cpp} (84%) rename Telegram/SourceFiles/mtproto/{mtp_abstract_socket.h => mtproto_abstract_socket.h} (100%) rename Telegram/SourceFiles/mtproto/{auth_key.cpp => mtproto_auth_key.cpp} (64%) rename Telegram/SourceFiles/mtproto/{auth_key.h => mtproto_auth_key.h} (100%) rename Telegram/SourceFiles/mtproto/{mtp_pch.cpp => mtproto_pch.cpp} (89%) rename Telegram/SourceFiles/mtproto/{mtp_pch.h => mtproto_pch.h} (100%) rename Telegram/SourceFiles/mtproto/{rpc_sender.cpp => mtproto_rpc_sender.cpp} (78%) rename Telegram/SourceFiles/mtproto/{rpc_sender.h => mtproto_rpc_sender.h} (99%) rename Telegram/SourceFiles/mtproto/{rsa_public_key.cpp => mtproto_rsa_public_key.cpp} (96%) rename Telegram/SourceFiles/mtproto/{rsa_public_key.h => mtproto_rsa_public_key.h} (100%) rename Telegram/SourceFiles/mtproto/{mtp_tcp_socket.cpp => mtproto_tcp_socket.cpp} (99%) rename Telegram/SourceFiles/mtproto/{mtp_tcp_socket.h => mtproto_tcp_socket.h} (95%) rename Telegram/SourceFiles/mtproto/{mtp_tls_socket.cpp => mtproto_tls_socket.cpp} (99%) rename Telegram/SourceFiles/mtproto/{mtp_tls_socket.h => mtproto_tls_socket.h} (97%) diff --git a/Telegram/SourceFiles/boxes/calendar_box.cpp b/Telegram/SourceFiles/boxes/calendar_box.cpp index 54b14b221..48cfdd794 100644 --- a/Telegram/SourceFiles/boxes/calendar_box.cpp +++ b/Telegram/SourceFiles/boxes/calendar_box.cpp @@ -7,7 +7,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL */ #include "boxes/calendar_box.h" -#include "mtproto/rpc_sender.h" +#include "mtproto/mtproto_rpc_sender.h" #include "ui/widgets/buttons.h" #include "lang/lang_keys.h" #include "ui/effects/ripple_animation.h" diff --git a/Telegram/SourceFiles/boxes/confirm_box.h b/Telegram/SourceFiles/boxes/confirm_box.h index cda3e0670..d3c53edda 100644 --- a/Telegram/SourceFiles/boxes/confirm_box.h +++ b/Telegram/SourceFiles/boxes/confirm_box.h @@ -8,7 +8,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #pragma once #include "boxes/abstract_box.h" -#include "mtproto/rpc_sender.h" +#include "mtproto/mtproto_rpc_sender.h" namespace Main { class Session; diff --git a/Telegram/SourceFiles/boxes/confirm_phone_box.h b/Telegram/SourceFiles/boxes/confirm_phone_box.h index b474df152..398b8062f 100644 --- a/Telegram/SourceFiles/boxes/confirm_phone_box.h +++ b/Telegram/SourceFiles/boxes/confirm_phone_box.h @@ -10,7 +10,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "boxes/abstract_box.h" #include "base/timer.h" #include "ui/widgets/input_fields.h" -#include "mtproto/rpc_sender.h" +#include "mtproto/mtproto_rpc_sender.h" namespace Ui { class InputField; diff --git a/Telegram/SourceFiles/boxes/edit_caption_box.h b/Telegram/SourceFiles/boxes/edit_caption_box.h index 59e821954..d5136afb4 100644 --- a/Telegram/SourceFiles/boxes/edit_caption_box.h +++ b/Telegram/SourceFiles/boxes/edit_caption_box.h @@ -11,7 +11,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "storage/storage_media_prepare.h" #include "ui/wrap/slide_wrap.h" #include "media/clip/media_clip_reader.h" -#include "mtproto/rpc_sender.h" +#include "mtproto/mtproto_rpc_sender.h" namespace ChatHelpers { class TabbedPanel; diff --git a/Telegram/SourceFiles/boxes/report_box.h b/Telegram/SourceFiles/boxes/report_box.h index 17ed36236..05782b8ce 100644 --- a/Telegram/SourceFiles/boxes/report_box.h +++ b/Telegram/SourceFiles/boxes/report_box.h @@ -8,7 +8,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #pragma once #include "boxes/abstract_box.h" -#include "mtproto/rpc_sender.h" +#include "mtproto/mtproto_rpc_sender.h" namespace Ui { template diff --git a/Telegram/SourceFiles/boxes/share_box.h b/Telegram/SourceFiles/boxes/share_box.h index 822c7477f..b5d3f5397 100644 --- a/Telegram/SourceFiles/boxes/share_box.h +++ b/Telegram/SourceFiles/boxes/share_box.h @@ -12,7 +12,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "base/timer.h" #include "ui/effects/animations.h" #include "ui/effects/round_checkbox.h" -#include "mtproto/rpc_sender.h" +#include "mtproto/mtproto_rpc_sender.h" enum class SendMenuType; diff --git a/Telegram/SourceFiles/boxes/username_box.h b/Telegram/SourceFiles/boxes/username_box.h index 433d9c05c..3a78c6596 100644 --- a/Telegram/SourceFiles/boxes/username_box.h +++ b/Telegram/SourceFiles/boxes/username_box.h @@ -8,7 +8,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #pragma once #include "boxes/abstract_box.h" -#include "mtproto/rpc_sender.h" +#include "mtproto/mtproto_rpc_sender.h" namespace Ui { class UsernameInput; diff --git a/Telegram/SourceFiles/calls/calls_call.h b/Telegram/SourceFiles/calls/calls_call.h index 04ade9804..2580b4026 100644 --- a/Telegram/SourceFiles/calls/calls_call.h +++ b/Telegram/SourceFiles/calls/calls_call.h @@ -11,7 +11,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "base/timer.h" #include "base/bytes.h" #include "mtproto/sender.h" -#include "mtproto/auth_key.h" +#include "mtproto/mtproto_auth_key.h" namespace Media { namespace Audio { diff --git a/Telegram/SourceFiles/core/application.h b/Telegram/SourceFiles/core/application.h index 57f3ace71..1f68e48a0 100644 --- a/Telegram/SourceFiles/core/application.h +++ b/Telegram/SourceFiles/core/application.h @@ -8,7 +8,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #pragma once #include "core/core_settings.h" -#include "mtproto/auth_key.h" +#include "mtproto/mtproto_auth_key.h" #include "mtproto/mtproto_proxy_data.h" #include "base/observer.h" #include "base/timer.h" diff --git a/Telegram/SourceFiles/core/utils.cpp b/Telegram/SourceFiles/core/utils.cpp index fd62a1716..f51c43323 100644 --- a/Telegram/SourceFiles/core/utils.cpp +++ b/Telegram/SourceFiles/core/utils.cpp @@ -58,12 +58,6 @@ static_assert(sizeof(MTPdouble) == 8, "Basic types size check failed"); static_assert(sizeof(int) >= 4, "Basic types size check failed"); -namespace { - -std::atomic GlobalAtomicRequestId = 0; - -} // namespace - // Precise timing functions / rand init struct CRYPTO_dynlock_value { @@ -206,14 +200,6 @@ namespace ThirdParty { } } -int GetNextRequestId() { - const auto result = ++GlobalAtomicRequestId; - if (result == std::numeric_limits::max() / 2) { - GlobalAtomicRequestId = 0; - } - return result; -} - int32 *hashSha1(const void *data, uint32 len, void *dest) { return (int32*)SHA1((const uchar*)data, (size_t)len, (uchar*)dest); } diff --git a/Telegram/SourceFiles/core/utils.h b/Telegram/SourceFiles/core/utils.h index 051ada8d2..44b2d53da 100644 --- a/Telegram/SourceFiles/core/utils.h +++ b/Telegram/SourceFiles/core/utils.h @@ -82,8 +82,6 @@ inline QByteArray str_const_toByteArray(const str_const &str) { return QByteArray::fromRawData(str.c_str(), str.size()); } -int GetNextRequestId(); - inline void mylocaltime(struct tm * _Tm, const time_t * _Time) { #ifdef Q_OS_WIN localtime_s(_Tm, _Time); @@ -161,8 +159,6 @@ T rand_value() { return result; } -static const QRegularExpression::PatternOptions reMultiline(QRegularExpression::DotMatchesEverythingOption | QRegularExpression::MultilineOption); - template inline T snap(const T &v, const T &_min, const T &_max) { return (v < _min) ? _min : ((v > _max) ? _max : v); diff --git a/Telegram/SourceFiles/dialogs/dialogs_inner_widget.h b/Telegram/SourceFiles/dialogs/dialogs_inner_widget.h index d0b8d5d7e..0015d4501 100644 --- a/Telegram/SourceFiles/dialogs/dialogs_inner_widget.h +++ b/Telegram/SourceFiles/dialogs/dialogs_inner_widget.h @@ -13,7 +13,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "ui/rp_widget.h" #include "base/flags.h" #include "base/object_ptr.h" -#include "mtproto/rpc_sender.h" +#include "mtproto/mtproto_rpc_sender.h" namespace Main { class Session; diff --git a/Telegram/SourceFiles/dialogs/dialogs_widget.h b/Telegram/SourceFiles/dialogs/dialogs_widget.h index 8d99ef5cc..42799d2dd 100644 --- a/Telegram/SourceFiles/dialogs/dialogs_widget.h +++ b/Telegram/SourceFiles/dialogs/dialogs_widget.h @@ -13,7 +13,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "ui/widgets/scroll_area.h" #include "ui/special_buttons.h" #include "api/api_single_message_search.h" -#include "mtproto/rpc_sender.h" +#include "mtproto/mtproto_rpc_sender.h" namespace Main { class Session; diff --git a/Telegram/SourceFiles/export/export_api_wrap.cpp b/Telegram/SourceFiles/export/export_api_wrap.cpp index ef8f938c6..8a6b29811 100644 --- a/Telegram/SourceFiles/export/export_api_wrap.cpp +++ b/Telegram/SourceFiles/export/export_api_wrap.cpp @@ -11,7 +11,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "export/data/export_data_types.h" #include "export/output/export_output_result.h" #include "export/output/export_output_file.h" -#include "mtproto/rpc_sender.h" +#include "mtproto/mtproto_rpc_sender.h" #include "base/value_ordering.h" #include "base/bytes.h" #include diff --git a/Telegram/SourceFiles/export/export_controller.h b/Telegram/SourceFiles/export/export_controller.h index 5dc59ad14..aa8afa9a4 100644 --- a/Telegram/SourceFiles/export/export_controller.h +++ b/Telegram/SourceFiles/export/export_controller.h @@ -7,9 +7,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL */ #pragma once -#include #include "base/variant.h" -#include "mtproto/rpc_sender.h" +#include "mtproto/mtproto_rpc_sender.h" + +#include namespace Export { diff --git a/Telegram/SourceFiles/main/main_account.h b/Telegram/SourceFiles/main/main_account.h index 6729c086e..64aff4a1c 100644 --- a/Telegram/SourceFiles/main/main_account.h +++ b/Telegram/SourceFiles/main/main_account.h @@ -7,7 +7,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL */ #pragma once -#include "mtproto/auth_key.h" +#include "mtproto/mtproto_auth_key.h" #include "mtproto/mtp_instance.h" #include "base/weak_ptr.h" diff --git a/Telegram/SourceFiles/mainwidget.h b/Telegram/SourceFiles/mainwidget.h index cdce6b299..d07cd1ddc 100644 --- a/Telegram/SourceFiles/mainwidget.h +++ b/Telegram/SourceFiles/mainwidget.h @@ -13,7 +13,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "ui/effects/animations.h" #include "media/player/media_player_float.h" #include "data/data_pts_waiter.h" -#include "mtproto/rpc_sender.h" +#include "mtproto/mtproto_rpc_sender.h" struct HistoryMessageMarkupButton; class MainWindow; diff --git a/Telegram/SourceFiles/mtproto/concurrent_sender.cpp b/Telegram/SourceFiles/mtproto/concurrent_sender.cpp index 1d687bbdb..b2ffb0028 100644 --- a/Telegram/SourceFiles/mtproto/concurrent_sender.cpp +++ b/Telegram/SourceFiles/mtproto/concurrent_sender.cpp @@ -8,7 +8,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "mtproto/concurrent_sender.h" #include "mtproto/mtp_instance.h" -#include "mtproto/rpc_sender.h" +#include "mtproto/mtproto_rpc_sender.h" #include "mtproto/facade.h" namespace MTP { @@ -135,7 +135,7 @@ void ConcurrentSender::RequestBuilder::setAfter( } mtpRequestId ConcurrentSender::RequestBuilder::send() { - const auto requestId = GetNextRequestId(); + const auto requestId = internal::GetNextRequestId(); const auto dcId = _dcId; const auto msCanWait = _canWait; const auto afterRequestId = _afterRequestId; diff --git a/Telegram/SourceFiles/mtproto/config_loader.h b/Telegram/SourceFiles/mtproto/config_loader.h index 923dc2e25..476e8f164 100644 --- a/Telegram/SourceFiles/mtproto/config_loader.h +++ b/Telegram/SourceFiles/mtproto/config_loader.h @@ -10,7 +10,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "base/timer.h" #include "base/weak_ptr.h" #include "base/bytes.h" -#include "mtproto/rpc_sender.h" +#include "mtproto/mtproto_rpc_sender.h" namespace MTP { diff --git a/Telegram/SourceFiles/mtproto/connection.cpp b/Telegram/SourceFiles/mtproto/connection.cpp index d5328d9d7..854469960 100644 --- a/Telegram/SourceFiles/mtproto/connection.cpp +++ b/Telegram/SourceFiles/mtproto/connection.cpp @@ -11,8 +11,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "mtproto/details/mtproto_dc_key_checker.h" #include "mtproto/details/mtproto_dump_to_text.h" #include "mtproto/session.h" -#include "mtproto/rsa_public_key.h" -#include "mtproto/rpc_sender.h" +#include "mtproto/mtproto_rsa_public_key.h" +#include "mtproto/mtproto_rpc_sender.h" #include "mtproto/dc_options.h" #include "mtproto/connection_abstract.h" #include "zlib.h" diff --git a/Telegram/SourceFiles/mtproto/connection.h b/Telegram/SourceFiles/mtproto/connection.h index 8a6084474..5e151b29a 100644 --- a/Telegram/SourceFiles/mtproto/connection.h +++ b/Telegram/SourceFiles/mtproto/connection.h @@ -7,7 +7,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL */ #pragma once -#include "mtproto/auth_key.h" +#include "mtproto/mtproto_auth_key.h" #include "mtproto/dc_options.h" #include "mtproto/connection_abstract.h" #include "mtproto/facade.h" diff --git a/Telegram/SourceFiles/mtproto/connection_resolving.h b/Telegram/SourceFiles/mtproto/connection_resolving.h index 4a91657db..ceb9c474e 100644 --- a/Telegram/SourceFiles/mtproto/connection_resolving.h +++ b/Telegram/SourceFiles/mtproto/connection_resolving.h @@ -7,7 +7,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL */ #pragma once -#include "mtproto/auth_key.h" +#include "mtproto/mtproto_auth_key.h" #include "mtproto/connection_abstract.h" #include "base/timer.h" diff --git a/Telegram/SourceFiles/mtproto/connection_tcp.cpp b/Telegram/SourceFiles/mtproto/connection_tcp.cpp index 2b73bce79..f46e16c26 100644 --- a/Telegram/SourceFiles/mtproto/connection_tcp.cpp +++ b/Telegram/SourceFiles/mtproto/connection_tcp.cpp @@ -7,7 +7,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL */ #include "mtproto/connection_tcp.h" -#include "mtproto/mtp_abstract_socket.h" +#include "mtproto/mtproto_abstract_socket.h" #include "base/bytes.h" #include "base/openssl_help.h" #include "base/qthelp_url.h" diff --git a/Telegram/SourceFiles/mtproto/connection_tcp.h b/Telegram/SourceFiles/mtproto/connection_tcp.h index 10da72760..07134f14f 100644 --- a/Telegram/SourceFiles/mtproto/connection_tcp.h +++ b/Telegram/SourceFiles/mtproto/connection_tcp.h @@ -8,7 +8,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #pragma once #include "mtproto/connection_abstract.h" -#include "mtproto/auth_key.h" +#include "mtproto/mtproto_auth_key.h" namespace MTP { namespace internal { diff --git a/Telegram/SourceFiles/mtproto/dc_options.h b/Telegram/SourceFiles/mtproto/dc_options.h index 71d3dec85..1e910f9a6 100644 --- a/Telegram/SourceFiles/mtproto/dc_options.h +++ b/Telegram/SourceFiles/mtproto/dc_options.h @@ -9,7 +9,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "base/observer.h" #include "base/bytes.h" -#include "mtproto/rsa_public_key.h" +#include "mtproto/mtproto_rsa_public_key.h" #include #include diff --git a/Telegram/SourceFiles/mtproto/dcenter.cpp b/Telegram/SourceFiles/mtproto/dcenter.cpp index 970ca3f39..65bd84fb9 100644 --- a/Telegram/SourceFiles/mtproto/dcenter.cpp +++ b/Telegram/SourceFiles/mtproto/dcenter.cpp @@ -8,7 +8,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "mtproto/dcenter.h" #include "mtproto/facade.h" -#include "mtproto/auth_key.h" +#include "mtproto/mtproto_auth_key.h" #include "mtproto/dc_options.h" #include "mtproto/mtp_instance.h" #include "mtproto/special_config_request.h" diff --git a/Telegram/SourceFiles/mtproto/details/mtproto_dc_key_checker.h b/Telegram/SourceFiles/mtproto/details/mtproto_dc_key_checker.h index 80cb5b4e9..85d4a55da 100644 --- a/Telegram/SourceFiles/mtproto/details/mtproto_dc_key_checker.h +++ b/Telegram/SourceFiles/mtproto/details/mtproto_dc_key_checker.h @@ -8,7 +8,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #pragma once #include "mtproto/core_types.h" -#include "mtproto/auth_key.h" +#include "mtproto/mtproto_auth_key.h" namespace MTP { class Instance; diff --git a/Telegram/SourceFiles/mtproto/details/mtproto_dc_key_creator.h b/Telegram/SourceFiles/mtproto/details/mtproto_dc_key_creator.h index c5738cd48..23dcadbd6 100644 --- a/Telegram/SourceFiles/mtproto/details/mtproto_dc_key_creator.h +++ b/Telegram/SourceFiles/mtproto/details/mtproto_dc_key_creator.h @@ -8,7 +8,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #pragma once #include "mtproto/core_types.h" -#include "mtproto/auth_key.h" +#include "mtproto/mtproto_auth_key.h" #include "mtproto/connection_abstract.h" #include "base/basic_types.h" #include "base/expected.h" diff --git a/Telegram/SourceFiles/mtproto/mtp_instance.cpp b/Telegram/SourceFiles/mtproto/mtp_instance.cpp index 62cd32a3a..c82305c6d 100644 --- a/Telegram/SourceFiles/mtproto/mtp_instance.cpp +++ b/Telegram/SourceFiles/mtproto/mtp_instance.cpp @@ -14,7 +14,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "mtproto/special_config_request.h" #include "mtproto/connection.h" #include "mtproto/sender.h" -#include "mtproto/rsa_public_key.h" +#include "mtproto/mtproto_rsa_public_key.h" #include "storage/localstorage.h" #include "calls/calls_instance.h" #include "main/main_session.h" // Session::Exists. @@ -37,8 +37,22 @@ constexpr auto kCheckKeyEach = 60 * crl::time(1000); using namespace internal; +std::atomic GlobalAtomicRequestId = 0; + } // namespace +namespace internal { + +int GetNextRequestId() { + const auto result = ++GlobalAtomicRequestId; + if (result == std::numeric_limits::max() / 2) { + GlobalAtomicRequestId = 0; + } + return result; +} + +} // namespace internal + class Instance::Private : private Sender { public: Private(not_null instance, not_null options, Instance::Mode mode); diff --git a/Telegram/SourceFiles/mtproto/mtp_instance.h b/Telegram/SourceFiles/mtproto/mtp_instance.h index 04a1afb1c..5443745c4 100644 --- a/Telegram/SourceFiles/mtproto/mtp_instance.h +++ b/Telegram/SourceFiles/mtproto/mtp_instance.h @@ -7,15 +7,17 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL */ #pragma once -#include -#include -#include "mtproto/rpc_sender.h" +#include "mtproto/mtproto_rpc_sender.h" namespace MTP { namespace internal { + class Dcenter; class Session; class Connection; + +[[nodiscard]] int GetNextRequestId(); + } // namespace internal class DcOptions; @@ -130,7 +132,7 @@ public: ShiftedDcId shiftedDcId = 0, crl::time msCanWait = 0, mtpRequestId afterRequestId = 0) { - const auto requestId = GetNextRequestId(); + const auto requestId = internal::GetNextRequestId(); sendSerialized( requestId, SecureRequest::Serialize(request), @@ -161,7 +163,7 @@ public: mtpRequestId sendProtocolMessage( ShiftedDcId shiftedDcId, const Request &request) { - const auto requestId = GetNextRequestId(); + const auto requestId = internal::GetNextRequestId(); sendRequest( requestId, SecureRequest::Serialize(request), diff --git a/Telegram/SourceFiles/mtproto/mtp_abstract_socket.cpp b/Telegram/SourceFiles/mtproto/mtproto_abstract_socket.cpp similarity index 84% rename from Telegram/SourceFiles/mtproto/mtp_abstract_socket.cpp rename to Telegram/SourceFiles/mtproto/mtproto_abstract_socket.cpp index 1de6e6654..2f77cd144 100644 --- a/Telegram/SourceFiles/mtproto/mtp_abstract_socket.cpp +++ b/Telegram/SourceFiles/mtproto/mtproto_abstract_socket.cpp @@ -5,10 +5,10 @@ the official desktop application for the Telegram messaging service. For license and copyright information please follow this link: https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL */ -#include "mtproto/mtp_abstract_socket.h" +#include "mtproto/mtproto_abstract_socket.h" -#include "mtproto/mtp_tcp_socket.h" -#include "mtproto/mtp_tls_socket.h" +#include "mtproto/mtproto_tcp_socket.h" +#include "mtproto/mtproto_tls_socket.h" namespace MTP { namespace internal { diff --git a/Telegram/SourceFiles/mtproto/mtp_abstract_socket.h b/Telegram/SourceFiles/mtproto/mtproto_abstract_socket.h similarity index 100% rename from Telegram/SourceFiles/mtproto/mtp_abstract_socket.h rename to Telegram/SourceFiles/mtproto/mtproto_abstract_socket.h diff --git a/Telegram/SourceFiles/mtproto/auth_key.cpp b/Telegram/SourceFiles/mtproto/mtproto_auth_key.cpp similarity index 64% rename from Telegram/SourceFiles/mtproto/auth_key.cpp rename to Telegram/SourceFiles/mtproto/mtproto_auth_key.cpp index 6df7761c3..b2991a880 100644 --- a/Telegram/SourceFiles/mtproto/auth_key.cpp +++ b/Telegram/SourceFiles/mtproto/mtproto_auth_key.cpp @@ -5,12 +5,11 @@ the official desktop application for the Telegram messaging service. For license and copyright information please follow this link: https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL */ -#include "mtproto/auth_key.h" +#include "mtproto/mtproto_auth_key.h" -extern "C" { -#include -#include -} // extern "C" +#include "base/openssl_help.h" + +#include namespace MTP { @@ -43,59 +42,61 @@ AuthKey::KeyId AuthKey::keyId() const { void AuthKey::prepareAES_oldmtp(const MTPint128 &msgKey, MTPint256 &aesKey, MTPint256 &aesIV, bool send) const { uint32 x = send ? 0 : 8; - uchar data_a[16 + 32], sha1_a[20]; - memcpy(data_a, &msgKey, 16); - memcpy(data_a + 16, _key.data() + x, 32); - hashSha1(data_a, 16 + 32, sha1_a); + bytes::array<20> sha1_a, sha1_b, sha1_c, sha1_d; + bytes::array<16 + 32> data_a; + memcpy(data_a.data(), &msgKey, 16); + memcpy(data_a.data() + 16, _key.data() + x, 32); + openssl::Sha1To(sha1_a, data_a); - uchar data_b[16 + 16 + 16], sha1_b[20]; - memcpy(data_b, _key.data() + 32 + x, 16); - memcpy(data_b + 16, &msgKey, 16); - memcpy(data_b + 32, _key.data() + 48 + x, 16); - hashSha1(data_b, 16 + 16 + 16, sha1_b); + bytes::array<16 + 16 + 16> data_b; + memcpy(data_b.data(), _key.data() + 32 + x, 16); + memcpy(data_b.data() + 16, &msgKey, 16); + memcpy(data_b.data() + 32, _key.data() + 48 + x, 16); + openssl::Sha1To(sha1_b, data_b); - uchar data_c[32 + 16], sha1_c[20]; - memcpy(data_c, _key.data() + 64 + x, 32); - memcpy(data_c + 32, &msgKey, 16); - hashSha1(data_c, 32 + 16, sha1_c); + bytes::array<32 + 16> data_c; + memcpy(data_c.data(), _key.data() + 64 + x, 32); + memcpy(data_c.data() + 32, &msgKey, 16); + openssl::Sha1To(sha1_c, data_c); - uchar data_d[16 + 32], sha1_d[20]; - memcpy(data_d, &msgKey, 16); - memcpy(data_d + 16, _key.data() + 96 + x, 32); - hashSha1(data_d, 16 + 32, sha1_d); + bytes::array<16 + 32> data_d; + memcpy(data_d.data(), &msgKey, 16); + memcpy(data_d.data() + 16, _key.data() + 96 + x, 32); + openssl::Sha1To(sha1_d, data_d); - auto key = reinterpret_cast(&aesKey); - auto iv = reinterpret_cast(&aesIV); - memcpy(key, sha1_a, 8); - memcpy(key + 8, sha1_b + 8, 12); - memcpy(key + 8 + 12, sha1_c + 4, 12); - memcpy(iv, sha1_a + 8, 12); - memcpy(iv + 12, sha1_b, 8); - memcpy(iv + 12 + 8, sha1_c + 16, 4); - memcpy(iv + 12 + 8 + 4, sha1_d, 8); + auto key = reinterpret_cast(&aesKey); + auto iv = reinterpret_cast(&aesIV); + memcpy(key, sha1_a.data(), 8); + memcpy(key + 8, sha1_b.data() + 8, 12); + memcpy(key + 8 + 12, sha1_c.data() + 4, 12); + memcpy(iv, sha1_a.data() + 8, 12); + memcpy(iv + 12, sha1_b.data(), 8); + memcpy(iv + 12 + 8, sha1_c.data() + 16, 4); + memcpy(iv + 12 + 8 + 4, sha1_d.data(), 8); } void AuthKey::prepareAES(const MTPint128 &msgKey, MTPint256 &aesKey, MTPint256 &aesIV, bool send) const { uint32 x = send ? 0 : 8; - uchar data_a[16 + 36], sha256_a[32]; - memcpy(data_a, &msgKey, 16); - memcpy(data_a + 16, _key.data() + x, 36); - hashSha256(data_a, 16 + 36, sha256_a); + bytes::array<32> sha256_a, sha256_b; + bytes::array<16 + 36> data_a; + memcpy(data_a.data(), &msgKey, 16); + memcpy(data_a.data() + 16, _key.data() + x, 36); + openssl::Sha256To(sha256_a, data_a); - uchar data_b[36 + 16], sha256_b[32]; - memcpy(data_b, _key.data() + 40 + x, 36); - memcpy(data_b + 36, &msgKey, 16); - hashSha256(data_b, 36 + 16, sha256_b); + bytes::array<36 + 16> data_b; + memcpy(data_b.data(), _key.data() + 40 + x, 36); + memcpy(data_b.data() + 36, &msgKey, 16); + openssl::Sha256To(sha256_b, data_b); auto key = reinterpret_cast(&aesKey); auto iv = reinterpret_cast(&aesIV); - memcpy(key, sha256_a, 8); - memcpy(key + 8, sha256_b + 8, 16); - memcpy(key + 8 + 16, sha256_a + 24, 8); - memcpy(iv, sha256_b, 8); - memcpy(iv + 8, sha256_a + 8, 16); - memcpy(iv + 8 + 16, sha256_b + 24, 8); + memcpy(key, sha256_a.data(), 8); + memcpy(key + 8, sha256_b.data() + 8, 16); + memcpy(key + 8 + 16, sha256_a.data() + 24, 8); + memcpy(iv, sha256_b.data(), 8); + memcpy(iv + 8, sha256_a.data() + 8, 16); + memcpy(iv + 8 + 16, sha256_b.data() + 24, 8); } const void *AuthKey::partForMsgKey(bool send) const { @@ -135,10 +136,10 @@ void AuthKey::FillData(Data &authKey, bytes::const_span computedAuthKey) { } void AuthKey::countKeyId() { - auto sha1 = hashSha1(_key.data(), _key.size()); + const auto hash = openssl::Sha1(_key); // Lower 64 bits = 8 bytes of 20 byte SHA1 hash. - _keyId = *reinterpret_cast(sha1.data() + 12); + _keyId = *reinterpret_cast(hash.data() + 12); } void aesIgeEncryptRaw(const void *src, void *dst, uint32 len, const void *key, const void *iv) { diff --git a/Telegram/SourceFiles/mtproto/auth_key.h b/Telegram/SourceFiles/mtproto/mtproto_auth_key.h similarity index 100% rename from Telegram/SourceFiles/mtproto/auth_key.h rename to Telegram/SourceFiles/mtproto/mtproto_auth_key.h diff --git a/Telegram/SourceFiles/mtproto/mtp_pch.cpp b/Telegram/SourceFiles/mtproto/mtproto_pch.cpp similarity index 89% rename from Telegram/SourceFiles/mtproto/mtp_pch.cpp rename to Telegram/SourceFiles/mtproto/mtproto_pch.cpp index 3194b80c1..bdad25fc3 100644 --- a/Telegram/SourceFiles/mtproto/mtp_pch.cpp +++ b/Telegram/SourceFiles/mtproto/mtproto_pch.cpp @@ -5,6 +5,6 @@ the official desktop application for the Telegram messaging service. For license and copyright information please follow this link: https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL */ -#include "mtproto/mtp_pch.h" +#include "mtproto/mtproto_pch.h" // Precompiled header helper. diff --git a/Telegram/SourceFiles/mtproto/mtp_pch.h b/Telegram/SourceFiles/mtproto/mtproto_pch.h similarity index 100% rename from Telegram/SourceFiles/mtproto/mtp_pch.h rename to Telegram/SourceFiles/mtproto/mtproto_pch.h diff --git a/Telegram/SourceFiles/mtproto/rpc_sender.cpp b/Telegram/SourceFiles/mtproto/mtproto_rpc_sender.cpp similarity index 78% rename from Telegram/SourceFiles/mtproto/rpc_sender.cpp rename to Telegram/SourceFiles/mtproto/mtproto_rpc_sender.cpp index a3859ec4f..b723fd292 100644 --- a/Telegram/SourceFiles/mtproto/rpc_sender.cpp +++ b/Telegram/SourceFiles/mtproto/mtproto_rpc_sender.cpp @@ -5,25 +5,28 @@ the official desktop application for the Telegram messaging service. For license and copyright information please follow this link: https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL */ -#include "mtproto/rpc_sender.h" +#include "mtproto/mtproto_rpc_sender.h" + +#include RPCError::RPCError(const MTPrpcError &error) : _code(error.c_rpc_error().verror_code().v) { QString text = qs(error.c_rpc_error().verror_message()); if (_code < 0 || _code >= 500) { - _type = qsl("INTERNAL_SERVER_ERROR"); + _type = "INTERNAL_SERVER_ERROR"; _description = text; } else { const auto expression = QRegularExpression( "^([A-Z0-9_]+)(: .*)?$", - reMultiline); + (QRegularExpression::DotMatchesEverythingOption + | QRegularExpression::MultilineOption)); const auto match = expression.match(text); if (match.hasMatch()) { _type = match.captured(1); _description = match.captured(2).mid(2); } else { - _type = qsl("CLIENT_BAD_RPC_ERROR"); - _description = qsl("Bad rpc error received, text = '") + text + '\''; + _type = "CLIENT_BAD_RPC_ERROR"; + _description = "Bad rpc error received, text = '" + text + '\''; } } } diff --git a/Telegram/SourceFiles/mtproto/rpc_sender.h b/Telegram/SourceFiles/mtproto/mtproto_rpc_sender.h similarity index 99% rename from Telegram/SourceFiles/mtproto/rpc_sender.h rename to Telegram/SourceFiles/mtproto/mtproto_rpc_sender.h index 4de116548..c3ae32324 100644 --- a/Telegram/SourceFiles/mtproto/rpc_sender.h +++ b/Telegram/SourceFiles/mtproto/mtproto_rpc_sender.h @@ -8,8 +8,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #pragma once #include "base/flat_set.h" -#include "core/utils.h" -#include class RPCError { public: diff --git a/Telegram/SourceFiles/mtproto/rsa_public_key.cpp b/Telegram/SourceFiles/mtproto/mtproto_rsa_public_key.cpp similarity index 96% rename from Telegram/SourceFiles/mtproto/rsa_public_key.cpp rename to Telegram/SourceFiles/mtproto/mtproto_rsa_public_key.cpp index 361c9930d..ca10f0a29 100644 --- a/Telegram/SourceFiles/mtproto/rsa_public_key.cpp +++ b/Telegram/SourceFiles/mtproto/mtproto_rsa_public_key.cpp @@ -5,17 +5,10 @@ the official desktop application for the Telegram messaging service. For license and copyright information please follow this link: https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL */ -#include "mtproto/rsa_public_key.h" +#include "mtproto/mtproto_rsa_public_key.h" #include "base/openssl_help.h" -extern "C" { -#include -#include -#include -#include -} // extern "C" - namespace MTP { namespace internal { namespace { @@ -234,8 +227,9 @@ void RSAPublicKey::Private::computeFingerprint() { MTP_bytes(ToBytes(n)).write(string); MTP_bytes(ToBytes(e)).write(string); - uchar sha1Buffer[20]; - _fingerprint = *(uint64*)(hashSha1(&string[0], string.size() * sizeof(mtpPrime), sha1Buffer) + 3); + bytes::array<20> sha1Buffer; + openssl::Sha1To(sha1Buffer, bytes::make_span(string)); + _fingerprint = *(uint64*)(sha1Buffer.data() + 12); } bytes::vector RSAPublicKey::Private::ToBytes(const BIGNUM *number) { diff --git a/Telegram/SourceFiles/mtproto/rsa_public_key.h b/Telegram/SourceFiles/mtproto/mtproto_rsa_public_key.h similarity index 100% rename from Telegram/SourceFiles/mtproto/rsa_public_key.h rename to Telegram/SourceFiles/mtproto/mtproto_rsa_public_key.h diff --git a/Telegram/SourceFiles/mtproto/mtp_tcp_socket.cpp b/Telegram/SourceFiles/mtproto/mtproto_tcp_socket.cpp similarity index 99% rename from Telegram/SourceFiles/mtproto/mtp_tcp_socket.cpp rename to Telegram/SourceFiles/mtproto/mtproto_tcp_socket.cpp index 3349cbadd..d2fbd6ad9 100644 --- a/Telegram/SourceFiles/mtproto/mtp_tcp_socket.cpp +++ b/Telegram/SourceFiles/mtproto/mtproto_tcp_socket.cpp @@ -5,7 +5,7 @@ the official desktop application for the Telegram messaging service. For license and copyright information please follow this link: https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL */ -#include "mtproto/mtp_tcp_socket.h" +#include "mtproto/mtproto_tcp_socket.h" #include "base/invoke_queued.h" diff --git a/Telegram/SourceFiles/mtproto/mtp_tcp_socket.h b/Telegram/SourceFiles/mtproto/mtproto_tcp_socket.h similarity index 95% rename from Telegram/SourceFiles/mtproto/mtp_tcp_socket.h rename to Telegram/SourceFiles/mtproto/mtproto_tcp_socket.h index 487b2dcc0..c8919fce2 100644 --- a/Telegram/SourceFiles/mtproto/mtp_tcp_socket.h +++ b/Telegram/SourceFiles/mtproto/mtproto_tcp_socket.h @@ -7,7 +7,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL */ #pragma once -#include "mtproto/mtp_abstract_socket.h" +#include "mtproto/mtproto_abstract_socket.h" namespace MTP { namespace internal { diff --git a/Telegram/SourceFiles/mtproto/mtp_tls_socket.cpp b/Telegram/SourceFiles/mtproto/mtproto_tls_socket.cpp similarity index 99% rename from Telegram/SourceFiles/mtproto/mtp_tls_socket.cpp rename to Telegram/SourceFiles/mtproto/mtproto_tls_socket.cpp index 691a482cd..8aa38f523 100644 --- a/Telegram/SourceFiles/mtproto/mtp_tls_socket.cpp +++ b/Telegram/SourceFiles/mtproto/mtproto_tls_socket.cpp @@ -5,9 +5,9 @@ the official desktop application for the Telegram messaging service. For license and copyright information please follow this link: https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL */ -#include "mtproto/mtp_tls_socket.h" +#include "mtproto/mtproto_tls_socket.h" -#include "mtproto/mtp_tcp_socket.h" +#include "mtproto/mtproto_tcp_socket.h" #include "base/openssl_help.h" #include "base/bytes.h" #include "base/invoke_queued.h" diff --git a/Telegram/SourceFiles/mtproto/mtp_tls_socket.h b/Telegram/SourceFiles/mtproto/mtproto_tls_socket.h similarity index 97% rename from Telegram/SourceFiles/mtproto/mtp_tls_socket.h rename to Telegram/SourceFiles/mtproto/mtproto_tls_socket.h index df8742b34..a93ef4014 100644 --- a/Telegram/SourceFiles/mtproto/mtp_tls_socket.h +++ b/Telegram/SourceFiles/mtproto/mtproto_tls_socket.h @@ -7,7 +7,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL */ #pragma once -#include "mtproto/mtp_abstract_socket.h" +#include "mtproto/mtproto_abstract_socket.h" namespace MTP { namespace internal { diff --git a/Telegram/SourceFiles/mtproto/sender.h b/Telegram/SourceFiles/mtproto/sender.h index ab6521735..3e1fd6c71 100644 --- a/Telegram/SourceFiles/mtproto/sender.h +++ b/Telegram/SourceFiles/mtproto/sender.h @@ -8,7 +8,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #pragma once #include "base/variant.h" -#include "mtproto/rpc_sender.h" +#include "mtproto/mtproto_rpc_sender.h" #include "mtproto/mtp_instance.h" #include "mtproto/facade.h" diff --git a/Telegram/SourceFiles/mtproto/session.cpp b/Telegram/SourceFiles/mtproto/session.cpp index 3d525cf7c..4ef0ecdd4 100644 --- a/Telegram/SourceFiles/mtproto/session.cpp +++ b/Telegram/SourceFiles/mtproto/session.cpp @@ -10,7 +10,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "mtproto/details/mtproto_dc_key_checker.h" #include "mtproto/connection.h" #include "mtproto/dcenter.h" -#include "mtproto/auth_key.h" +#include "mtproto/mtproto_auth_key.h" #include "base/unixtime.h" #include "base/openssl_help.h" #include "core/crash_reports.h" diff --git a/Telegram/SourceFiles/mtproto/session.h b/Telegram/SourceFiles/mtproto/session.h index 1d6ffb68c..cc5a03d6d 100644 --- a/Telegram/SourceFiles/mtproto/session.h +++ b/Telegram/SourceFiles/mtproto/session.h @@ -8,7 +8,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #pragma once #include "base/timer.h" -#include "mtproto/rpc_sender.h" +#include "mtproto/mtproto_rpc_sender.h" #include "mtproto/mtproto_proxy_data.h" #include diff --git a/Telegram/SourceFiles/mtproto/special_config_request.cpp b/Telegram/SourceFiles/mtproto/special_config_request.cpp index 362a21d7a..992c436c6 100644 --- a/Telegram/SourceFiles/mtproto/special_config_request.cpp +++ b/Telegram/SourceFiles/mtproto/special_config_request.cpp @@ -7,9 +7,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL */ #include "mtproto/special_config_request.h" -#include "mtproto/rsa_public_key.h" +#include "mtproto/mtproto_rsa_public_key.h" #include "mtproto/dc_options.h" -#include "mtproto/auth_key.h" +#include "mtproto/mtproto_auth_key.h" #include "base/unixtime.h" #include "base/openssl_help.h" #include "base/call_delayed.h" diff --git a/Telegram/SourceFiles/passport/passport_encryption.cpp b/Telegram/SourceFiles/passport/passport_encryption.cpp index c37e53872..ce83fa5d8 100644 --- a/Telegram/SourceFiles/passport/passport_encryption.cpp +++ b/Telegram/SourceFiles/passport/passport_encryption.cpp @@ -8,7 +8,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "passport/passport_encryption.h" #include "base/openssl_help.h" -#include "mtproto/rsa_public_key.h" +#include "mtproto/mtproto_rsa_public_key.h" #include #include diff --git a/Telegram/SourceFiles/storage/serialize_common.h b/Telegram/SourceFiles/storage/serialize_common.h index 679c0fece..a1acb9b6b 100644 --- a/Telegram/SourceFiles/storage/serialize_common.h +++ b/Telegram/SourceFiles/storage/serialize_common.h @@ -7,7 +7,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL */ #pragma once -#include "mtproto/auth_key.h" +#include "mtproto/mtproto_auth_key.h" namespace Serialize { diff --git a/Telegram/gyp/lib_mtproto.gyp b/Telegram/gyp/lib_mtproto.gyp index bbc7a3e17..99ec10634 100644 --- a/Telegram/gyp/lib_mtproto.gyp +++ b/Telegram/gyp/lib_mtproto.gyp @@ -19,8 +19,8 @@ 'variables': { 'src_loc': '../SourceFiles', 'res_loc': '../Resources', - 'pch_source': '<(src_loc)/mtproto/mtp_pch.cpp', - 'pch_header': '<(src_loc)/mtproto/mtp_pch.h', + 'pch_source': '<(src_loc)/mtproto/mtproto_pch.cpp', + 'pch_header': '<(src_loc)/mtproto/mtproto_pch.h', }, 'defines': [ ], @@ -40,16 +40,22 @@ '<(src_loc)/mtproto/details/mtproto_dc_key_creator.h', '<(src_loc)/mtproto/details/mtproto_dump_to_text.cpp', '<(src_loc)/mtproto/details/mtproto_dump_to_text.h', + '<(src_loc)/mtproto/mtproto_abstract_socket.cpp', + '<(src_loc)/mtproto/mtproto_abstract_socket.h', + '<(src_loc)/mtproto/mtproto_auth_key.cpp', + '<(src_loc)/mtproto/mtproto_auth_key.h', '<(src_loc)/mtproto/mtproto_dh_utils.cpp', '<(src_loc)/mtproto/mtproto_dh_utils.h', '<(src_loc)/mtproto/mtproto_proxy_data.cpp', '<(src_loc)/mtproto/mtproto_proxy_data.h', - '<(src_loc)/mtproto/mtp_abstract_socket.cpp', - '<(src_loc)/mtproto/mtp_abstract_socket.h', - '<(src_loc)/mtproto/mtp_tcp_socket.cpp', - '<(src_loc)/mtproto/mtp_tcp_socket.h', - '<(src_loc)/mtproto/mtp_tls_socket.cpp', - '<(src_loc)/mtproto/mtp_tls_socket.h', + '<(src_loc)/mtproto/mtproto_rsa_public_key.cpp', + '<(src_loc)/mtproto/mtproto_rsa_public_key.h', + '<(src_loc)/mtproto/mtproto_rpc_sender.cpp', + '<(src_loc)/mtproto/mtproto_rpc_sender.h', + '<(src_loc)/mtproto/mtproto_tcp_socket.cpp', + '<(src_loc)/mtproto/mtproto_tcp_socket.h', + '<(src_loc)/mtproto/mtproto_tls_socket.cpp', + '<(src_loc)/mtproto/mtproto_tls_socket.h', ], }], } diff --git a/Telegram/gyp/telegram/sources.txt b/Telegram/gyp/telegram/sources.txt index ca89de7a3..e7ccceed3 100644 --- a/Telegram/gyp/telegram/sources.txt +++ b/Telegram/gyp/telegram/sources.txt @@ -533,8 +533,6 @@ <(src_loc)/media/view/media_view_group_thumbs.h <(src_loc)/media/view/media_view_overlay_widget.cpp <(src_loc)/media/view/media_view_overlay_widget.h -<(src_loc)/mtproto/auth_key.cpp -<(src_loc)/mtproto/auth_key.h <(src_loc)/mtproto/concurrent_sender.cpp <(src_loc)/mtproto/concurrent_sender.h <(src_loc)/mtproto/config_loader.cpp @@ -561,10 +559,6 @@ <(src_loc)/mtproto/facade.h <(src_loc)/mtproto/mtp_instance.cpp <(src_loc)/mtproto/mtp_instance.h -<(src_loc)/mtproto/rsa_public_key.cpp -<(src_loc)/mtproto/rsa_public_key.h -<(src_loc)/mtproto/rpc_sender.cpp -<(src_loc)/mtproto/rpc_sender.h <(src_loc)/mtproto/sender.h <(src_loc)/mtproto/session.cpp <(src_loc)/mtproto/session.h diff --git a/Telegram/lib_base b/Telegram/lib_base index bdc4127ff..95ea34f59 160000 --- a/Telegram/lib_base +++ b/Telegram/lib_base @@ -1 +1 @@ -Subproject commit bdc4127ff5d5a14eb9d04986725ef7ec94e6d807 +Subproject commit 95ea34f59c2e747343aef9c78dd1afbd3fa086c2