diff --git a/Telegram/SourceFiles/core/sandbox.cpp b/Telegram/SourceFiles/core/sandbox.cpp index 4ea9ab91a..d39a10532 100644 --- a/Telegram/SourceFiles/core/sandbox.cpp +++ b/Telegram/SourceFiles/core/sandbox.cpp @@ -446,7 +446,6 @@ void Sandbox::checkForQuit() { } void Sandbox::refreshGlobalProxy() { -#ifndef TDESKTOP_DISABLE_NETWORK_PROXY const auto proxy = !Global::started() ? _sandboxProxy : (Global::ProxySettings() == MTP::ProxyData::Settings::Enabled) @@ -462,7 +461,6 @@ void Sandbox::refreshGlobalProxy() { } else { QNetworkProxy::setApplicationProxy(QNetworkProxy::NoProxy); } -#endif // TDESKTOP_DISABLE_NETWORK_PROXY } uint64 Sandbox::installationTag() const { diff --git a/Telegram/SourceFiles/platform/linux/specific_linux.cpp b/Telegram/SourceFiles/platform/linux/specific_linux.cpp index 308819e0e..4207d75a6 100644 --- a/Telegram/SourceFiles/platform/linux/specific_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/specific_linux.cpp @@ -1461,7 +1461,6 @@ void InstallMainDesktopFile() { } void RegisterCustomScheme(bool force) { -#ifndef TDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME if (cExeName().isEmpty()) { return; } @@ -1510,7 +1509,6 @@ void RegisterCustomScheme(bool force) { LOG(("App Error: %1").arg(error->message)); g_error_free(error); } -#endif // !TDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME } PermissionStatus GetPermissionStatus(PermissionType type) { diff --git a/Telegram/SourceFiles/platform/mac/specific_mac.mm b/Telegram/SourceFiles/platform/mac/specific_mac.mm index f2334247a..1d7bfefc5 100644 --- a/Telegram/SourceFiles/platform/mac/specific_mac.mm +++ b/Telegram/SourceFiles/platform/mac/specific_mac.mm @@ -158,10 +158,8 @@ std::optional IsDarkMode() { } void RegisterCustomScheme(bool force) { -#ifndef TDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME OSStatus result = LSSetDefaultHandlerForURLScheme(CFSTR("tg"), (CFStringRef)[[NSBundle mainBundle] bundleIdentifier]); DEBUG_LOG(("App Info: set default handler for 'tg' scheme result: %1").arg(result)); -#endif // !TDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME } // I do check for availability, just not in the exact way clang is content with diff --git a/Telegram/SourceFiles/platform/win/specific_win.cpp b/Telegram/SourceFiles/platform/win/specific_win.cpp index 4facf6c06..38cc936db 100644 --- a/Telegram/SourceFiles/platform/win/specific_win.cpp +++ b/Telegram/SourceFiles/platform/win/specific_win.cpp @@ -509,7 +509,6 @@ void RegisterCustomScheme(bool force) { if (cExeName().isEmpty()) { return; } -#ifndef TDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME DEBUG_LOG(("App Info: Checking custom scheme 'tg'...")); HKEY rkey; @@ -547,7 +546,6 @@ void RegisterCustomScheme(bool force) { if (!_psOpenRegKey(L"Software\\RegisteredApplications", &rkey)) return; if (!_psSetKeyValue(rkey, L"Telegram Desktop", qsl("SOFTWARE\\TelegramDesktop\\Capabilities"))) return; -#endif // !TDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME } PermissionStatus GetPermissionStatus(PermissionType type) { diff --git a/Telegram/SourceFiles/settings/settings_advanced.cpp b/Telegram/SourceFiles/settings/settings_advanced.cpp index 1532abeb7..2e7d9ecc2 100644 --- a/Telegram/SourceFiles/settings/settings_advanced.cpp +++ b/Telegram/SourceFiles/settings/settings_advanced.cpp @@ -43,20 +43,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL namespace Settings { -bool HasConnectionType() { -#ifndef TDESKTOP_DISABLE_NETWORK_PROXY - return true; -#endif // TDESKTOP_DISABLE_NETWORK_PROXY - return false; -} - void SetupConnectionType( not_null account, not_null container) { - if (!HasConnectionType()) { - return; - } -#ifndef TDESKTOP_DISABLE_NETWORK_PROXY const auto connectionType = [=] { const auto transport = account->mtp().dctransport(); if (Global::ProxySettings() != MTP::ProxyData::Settings::Enabled) { @@ -81,7 +70,6 @@ void SetupConnectionType( button->addClickHandler([=] { Ui::show(ProxiesBoxController::CreateOwningBox(account)); }); -#endif // TDESKTOP_DISABLE_NETWORK_PROXY } bool HasUpdate() { @@ -571,13 +559,11 @@ void Advanced::setupContent(not_null controller) { if (!cAutoUpdate()) { addUpdate(); } - if (HasConnectionType()) { - addDivider(); - AddSkip(content); - AddSubsectionTitle(content, tr::lng_settings_network_proxy()); - SetupConnectionType(&controller->session().account(), content); - AddSkip(content); - } + addDivider(); + AddSkip(content); + AddSubsectionTitle(content, tr::lng_settings_network_proxy()); + SetupConnectionType(&controller->session().account(), content); + AddSkip(content); SetupDataStorage(controller, content); SetupAutoDownload(controller, content); SetupSystemIntegration(content, [=](Type type) { diff --git a/Telegram/SourceFiles/settings/settings_advanced.h b/Telegram/SourceFiles/settings/settings_advanced.h index 5b2cf9c3d..220b8be1a 100644 --- a/Telegram/SourceFiles/settings/settings_advanced.h +++ b/Telegram/SourceFiles/settings/settings_advanced.h @@ -15,7 +15,6 @@ class Account; namespace Settings { -bool HasConnectionType(); void SetupConnectionType( not_null account, not_null container); diff --git a/Telegram/SourceFiles/settings/settings_codes.cpp b/Telegram/SourceFiles/settings/settings_codes.cpp index 9b4ce3a21..0a41ae714 100644 --- a/Telegram/SourceFiles/settings/settings_codes.cpp +++ b/Telegram/SourceFiles/settings/settings_codes.cpp @@ -128,13 +128,10 @@ auto GenerateCodes() { Ui::hideLayer(); })); }); - -#ifndef TDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME codes.emplace(qsl("registertg"), [](SessionController *window) { Platform::RegisterCustomScheme(true); Ui::Toast::Show("Forced custom scheme register."); }); -#endif // !TDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME #if defined Q_OS_WIN || defined Q_OS_MAC codes.emplace(qsl("freetype"), [](SessionController *window) { diff --git a/Telegram/SourceFiles/settings/settings_intro.cpp b/Telegram/SourceFiles/settings/settings_intro.cpp index 5d7a9c29c..bc4e42f10 100644 --- a/Telegram/SourceFiles/settings/settings_intro.cpp +++ b/Telegram/SourceFiles/settings/settings_intro.cpp @@ -65,9 +65,7 @@ object_ptr CreateIntroSettings( AddDivider(result); AddSkip(result); SetupLanguageButton(result, false); - if (HasConnectionType()) { - SetupConnectionType(&window->account(), result); - } + SetupConnectionType(&window->account(), result); AddSkip(result); if (HasUpdate()) { AddDivider(result); diff --git a/Telegram/cmake/telegram_options.cmake b/Telegram/cmake/telegram_options.cmake index 2e6e9188a..a67da47f3 100644 --- a/Telegram/cmake/telegram_options.cmake +++ b/Telegram/cmake/telegram_options.cmake @@ -4,8 +4,6 @@ # For license and copyright information please follow this link: # https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL -option(TDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME "Disable automatic 'tg://' URL scheme handler registration." OFF) -option(TDESKTOP_DISABLE_NETWORK_PROXY "Disable all code for working through Socks5 or MTProxy." OFF) option(TDESKTOP_DISABLE_GTK_INTEGRATION "Disable all code for GTK integration (Linux only)." OFF) option(TDESKTOP_API_TEST "Use test API credentials." OFF) set(TDESKTOP_API_ID "0" CACHE STRING "Provide 'api_id' for the Telegram API access.") @@ -54,14 +52,6 @@ if (DESKTOP_APP_SPECIAL_TARGET) target_compile_definitions(Telegram PRIVATE TDESKTOP_ALLOW_CLOSED_ALPHA) endif() -if (TDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME) - target_compile_definitions(Telegram PRIVATE TDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME) -endif() - -if (TDESKTOP_DISABLE_NETWORK_PROXY) - target_compile_definitions(Telegram PRIVATE TDESKTOP_DISABLE_NETWORK_PROXY) -endif() - if (TDESKTOP_DISABLE_GTK_INTEGRATION) target_compile_definitions(Telegram PRIVATE TDESKTOP_DISABLE_GTK_INTEGRATION) endif()