diff --git a/Telegram/SourceFiles/boxes/connection_box.cpp b/Telegram/SourceFiles/boxes/connection_box.cpp index 921c98b1cf093d..416292765d7253 100644 --- a/Telegram/SourceFiles/boxes/connection_box.cpp +++ b/Telegram/SourceFiles/boxes/connection_box.cpp @@ -1716,7 +1716,9 @@ void ProxiesBoxController::setTryIPv6(bool enabled) { return; } Core::App().settings().proxy().setTryIPv6(enabled); +#if 0 // mtp _account->mtp().restart(); +#endif _settings.connectionTypeChangesNotify(); saveDelayed(); } diff --git a/Telegram/SourceFiles/export/export_manager.cpp b/Telegram/SourceFiles/export/export_manager.cpp index dfc25639657726..2eaf2058d8ff07 100644 --- a/Telegram/SourceFiles/export/export_manager.cpp +++ b/Telegram/SourceFiles/export/export_manager.cpp @@ -34,9 +34,12 @@ void Manager::start( _panel->activatePanel(); return; } +#if 0 // tdlib todo export _controller = std::make_unique( &session->mtp(), singlePeer); +#endif + return; _panel = std::make_unique( session, _controller.get()); diff --git a/Telegram/SourceFiles/main/main_session.cpp b/Telegram/SourceFiles/main/main_session.cpp index b7768bfe1e4338..72b6d0264cacc3 100644 --- a/Telegram/SourceFiles/main/main_session.cpp +++ b/Telegram/SourceFiles/main/main_session.cpp @@ -284,7 +284,7 @@ Tdb::Account &Session::tdb() const { return _account->tdb(); } -Tdb::Sender &Session::sender() { +Tdb::Sender &Session::sender() const { return *_sender; } @@ -402,11 +402,11 @@ void Session::saveSettingsNowIfNeeded() { MTP::DcId Session::mainDcId() const { return _account->mtp().mainDcId(); } -#endif MTP::Instance &Session::mtp() const { return _account->mtp(); } +#endif const MTP::ConfigFields &Session::serverConfig() const { return _account->mtp().configValues(); diff --git a/Telegram/SourceFiles/main/main_session.h b/Telegram/SourceFiles/main/main_session.h index 2227a9a7c969ec..82c33893c4052e 100644 --- a/Telegram/SourceFiles/main/main_session.h +++ b/Telegram/SourceFiles/main/main_session.h @@ -111,7 +111,13 @@ class Session final : public base::has_weak_ptr { [[nodiscard]] AppConfig &appConfig() const; [[nodiscard]] Tdb::Account &tdb() const; - [[nodiscard]] Tdb::Sender &sender(); + [[nodiscard]] Tdb::Sender &sender() const; + + // For using legacy code MTP::Sender _api; _api(&session->mtp()). + [[nodiscard]] Tdb::Sender &mtp() const { + return sender(); + } + [[nodiscard]] bool loggingOut() const; bool apply(const Tdb::TLDupdateOption &option); @@ -212,8 +218,8 @@ class Session final : public base::has_weak_ptr { [[nodiscard]] rpl::producer<> downloaderTaskFinished() const; #if 0 // mtp [[nodiscard]] MTP::DcId mainDcId() const; -#endif [[nodiscard]] MTP::Instance &mtp() const; +#endif [[nodiscard]] const MTP::ConfigFields &serverConfig() const; [[nodiscard]] ApiWrap &api() { return *_api; diff --git a/Telegram/SourceFiles/settings/settings_advanced.cpp b/Telegram/SourceFiles/settings/settings_advanced.cpp index a2ae6487ad7281..4a47b38662ecac 100644 --- a/Telegram/SourceFiles/settings/settings_advanced.cpp +++ b/Telegram/SourceFiles/settings/settings_advanced.cpp @@ -75,6 +75,7 @@ void SetupConnectionType( not_null account, not_null container) { const auto connectionType = [=] { +#if 0 // todo const auto transport = account->mtp().dctransport(); if (!Core::App().settings().proxy().isEnabled()) { return transport.isEmpty() @@ -85,6 +86,8 @@ void SetupConnectionType( ? tr::lng_connection_proxy_connecting(tr::now) : tr::lng_connection_proxy(tr::now, lt_transport, transport); } +#endif + return u"TDLib"_q; }; const auto button = AddButtonWithLabel( container, diff --git a/Telegram/SourceFiles/settings/settings_codes.cpp b/Telegram/SourceFiles/settings/settings_codes.cpp index 718eda077d2997..bcb8a33ab9d460 100644 --- a/Telegram/SourceFiles/settings/settings_codes.cpp +++ b/Telegram/SourceFiles/settings/settings_codes.cpp @@ -117,6 +117,7 @@ auto GenerateCodes() { } }); }); +#if 0 // mtp codes.emplace(u"endpoints"_q, [](SessionController *window) { if (!Core::App().domain().started()) { return; @@ -142,6 +143,7 @@ auto GenerateCodes() { } }); }); +#endif codes.emplace(u"testmode"_q, [](SessionController *window) { auto &domain = Core::App().domain(); if (domain.started() diff --git a/Telegram/SourceFiles/settings/settings_information.cpp b/Telegram/SourceFiles/settings/settings_information.cpp index 7be04db17b05ef..079f87d995df47 100644 --- a/Telegram/SourceFiles/settings/settings_information.cpp +++ b/Telegram/SourceFiles/settings/settings_information.cpp @@ -886,7 +886,10 @@ not_null*> AccountsList::setupAdd() { for (const auto &[index, account] : domain.accounts()) { const auto raw = account.get(); if (!raw->sessionExists() +#if 0 // mtp && raw->mtp().environment() == environment) { +#endif + && raw->testMode() == (environment == Environment::Test)) { found = true; } } diff --git a/Telegram/SourceFiles/window/window_connecting_widget.cpp b/Telegram/SourceFiles/window/window_connecting_widget.cpp index 8f83d321cb8927..ec872afd6aa41c 100644 --- a/Telegram/SourceFiles/window/window_connecting_widget.cpp +++ b/Telegram/SourceFiles/window/window_connecting_widget.cpp @@ -646,7 +646,9 @@ void ConnectionState::Widget::refreshRetryLink(bool hasRetry) { tr::lng_reconnecting_try_now(tr::now), st::connectingRetryLink); _retry->addClickHandler([=] { +#if 0 // todo _account->mtp().restart(); +#endif }); updateRetryGeometry(); } else if (!hasRetry) {