diff --git a/Telegram/SourceFiles/boxes/sessions_box.cpp b/Telegram/SourceFiles/boxes/sessions_box.cpp index 1d4d013950..5ede4940da 100644 --- a/Telegram/SourceFiles/boxes/sessions_box.cpp +++ b/Telegram/SourceFiles/boxes/sessions_box.cpp @@ -129,7 +129,7 @@ void SessionInfoBox( [[nodiscard]] QString LocationAndDate(const EntryData &entry) { return (entry.location.isEmpty() ? entry.ip : entry.location) + (entry.hash - ? (QString::fromUtf8(" \xe2\x80\x93 ") + entry.active) + ? (QString::fromUtf8(" \xE2\x80\xA2 ") + entry.active) : QString()); } @@ -768,6 +768,7 @@ Sessions::Sessions( void Sessions::setupContent(not_null controller) { const auto container = Ui::CreateChild(this); + AddSkip(container, st::settingsPrivacySkip); const auto content = container->add( object_ptr(container, controller)); content->setupContent(); diff --git a/Telegram/SourceFiles/core/local_url_handlers.cpp b/Telegram/SourceFiles/core/local_url_handlers.cpp index 59d8c1bfbc..0a3671611c 100644 --- a/Telegram/SourceFiles/core/local_url_handlers.cpp +++ b/Telegram/SourceFiles/core/local_url_handlers.cpp @@ -376,17 +376,16 @@ bool ResolveSettings( if (section.isEmpty()) { controller->window().showSettings(); return true; - } - if (section == qstr("devices")) { - controller->session().api().authorizations().reload(); - controller->show(Box(controller)); - return true; } else if (section == qstr("language")) { ShowLanguagesBox(); return true; + } else if (section == qstr("devices")) { + controller->session().api().authorizations().reload(); } const auto type = (section == qstr("folders")) ? ::Settings::Type::Folders + : (section == qstr("devices")) + ? ::Settings::Type::Sessions : ::Settings::Type::Main; controller->showSettings(type); return true; diff --git a/Telegram/SourceFiles/info/info_top_bar.cpp b/Telegram/SourceFiles/info/info_top_bar.cpp index fae562b0c5..f7e01b8076 100644 --- a/Telegram/SourceFiles/info/info_top_bar.cpp +++ b/Telegram/SourceFiles/info/info_top_bar.cpp @@ -617,6 +617,8 @@ rpl::producer TitleValue( return tr::lng_settings_section_notify(); case Section::SettingsType::PrivacySecurity: return tr::lng_settings_section_privacy(); + case Section::SettingsType::Sessions: + return tr::lng_settings_sessions_title(); case Section::SettingsType::Advanced: return tr::lng_settings_advanced(); case Section::SettingsType::Chat: diff --git a/Telegram/SourceFiles/settings/settings_common.cpp b/Telegram/SourceFiles/settings/settings_common.cpp index 7b9e48c558..5bfa90baed 100644 --- a/Telegram/SourceFiles/settings/settings_common.cpp +++ b/Telegram/SourceFiles/settings/settings_common.cpp @@ -22,6 +22,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "ui/widgets/box_content_divider.h" #include "ui/widgets/buttons.h" #include "boxes/abstract_box.h" +#include "boxes/sessions_box.h" #include "window/themes/window_theme_editor_box.h" #include "window/window_session_controller.h" #include "window/window_controller.h" @@ -47,6 +48,8 @@ object_ptr
CreateSection( return object_ptr(parent, controller); case Type::PrivacySecurity: return object_ptr(parent, controller); + case Type::Sessions: + return object_ptr(parent, controller); case Type::Advanced: return object_ptr(parent, controller); case Type::Folders: diff --git a/Telegram/SourceFiles/settings/settings_common.h b/Telegram/SourceFiles/settings/settings_common.h index a8d8ae6f1a..1f34036f33 100644 --- a/Telegram/SourceFiles/settings/settings_common.h +++ b/Telegram/SourceFiles/settings/settings_common.h @@ -36,6 +36,7 @@ enum class Type { Information, Notifications, PrivacySecurity, + Sessions, Advanced, Chat, Folders, diff --git a/Telegram/SourceFiles/settings/settings_privacy_security.cpp b/Telegram/SourceFiles/settings/settings_privacy_security.cpp index 049ea5c487..bf6340dfde 100644 --- a/Telegram/SourceFiles/settings/settings_privacy_security.cpp +++ b/Telegram/SourceFiles/settings/settings_privacy_security.cpp @@ -780,7 +780,8 @@ void SetupBotsAndWebsites( void SetupSessionsList( not_null controller, not_null container, - rpl::producer<> updateTrigger) { + rpl::producer<> updateTrigger, + Fn showOther) { AddSkip(container); AddSubsectionTitle(container, tr::lng_settings_sessions_title()); @@ -801,7 +802,7 @@ void SetupSessionsList( std::move(count), st::settingsButton )->addClickHandler([=] { - controller->show(Box(controller)); + showOther(Type::Sessions); }); AddSkip(container, st::settingsPrivacySecurityPadding); AddDividerText(container, tr::lng_settings_sessions_about()); @@ -929,6 +930,10 @@ PrivacySecurity::PrivacySecurity( setupContent(controller); } +rpl::producer PrivacySecurity::sectionShowOther() { + return _showOther.events(); +} + void PrivacySecurity::setupContent( not_null controller) { const auto content = Ui::CreateChild(this); @@ -941,7 +946,9 @@ void PrivacySecurity::setupContent( SetupPrivacy(controller, content, trigger()); SetupArchiveAndMute(controller, content); - SetupSessionsList(controller, content, trigger()); + SetupSessionsList(controller, content, trigger(), [=](Type type) { + _showOther.fire_copy(type); + }); SetupLocalPasscode(controller, content); SetupCloudPassword(controller, content); #if !defined OS_MAC_STORE && !defined OS_WIN_STORE diff --git a/Telegram/SourceFiles/settings/settings_privacy_security.h b/Telegram/SourceFiles/settings/settings_privacy_security.h index 52070759ea..698148b4af 100644 --- a/Telegram/SourceFiles/settings/settings_privacy_security.h +++ b/Telegram/SourceFiles/settings/settings_privacy_security.h @@ -39,9 +39,13 @@ public: QWidget *parent, not_null controller); + rpl::producer sectionShowOther() override; + private: void setupContent(not_null controller); + rpl::event_stream _showOther; + }; } // namespace Settings