From 300cc3dbca2f6ee3706c04048dfff81b5bfaeff3 Mon Sep 17 00:00:00 2001 From: CrisMystik <62919067+CrisMystik@users.noreply.github.com> Date: Sat, 23 Apr 2022 21:54:12 +0200 Subject: [PATCH] Support all Settings links --- .../SourceFiles/core/local_url_handlers.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/Telegram/SourceFiles/core/local_url_handlers.cpp b/Telegram/SourceFiles/core/local_url_handlers.cpp index 5ad280e29f..c489b78f6d 100644 --- a/Telegram/SourceFiles/core/local_url_handlers.cpp +++ b/Telegram/SourceFiles/core/local_url_handlers.cpp @@ -444,6 +444,7 @@ bool ResolveSettings( } controller->window().activate(); const auto section = match->captured(1).mid(1).toLower(); + auto type = ::Settings::Main::Id(); if (section.isEmpty()) { controller->window().showSettings(); return true; @@ -452,12 +453,16 @@ bool ResolveSettings( return true; } else if (section == qstr("devices")) { controller->session().api().authorizations().reload(); + type = ::Settings::Sessions::Id(); + } else if (section == qstr("folders")) { + type = ::Settings::Folders::Id(); + } else if (section == qstr("privacy")) { + type = ::Settings::PrivacySecurity::Id(); + } else if (section == qstr("themes")) { + type = ::Settings::Chat::Id(); + } else if (section == qstr("change_number")) { + type = ::Settings::ChangePhone::Id(); } - const auto type = (section == qstr("folders")) - ? ::Settings::Folders::Id() - : (section == qstr("devices")) - ? ::Settings::Sessions::Id() - : ::Settings::Main::Id(); controller->showSettings(type); controller->window().activate(); return true; @@ -760,7 +765,7 @@ const std::vector &LocalUrlHandlers() { ResolvePrivatePost }, { - qsl("^settings(/folders|/devices|/language)?$"), + qsl("^settings(/language|/devices|/folders|/privacy|/themes|/change_number)?$"), ResolveSettings }, {