diff --git a/Telegram/SourceFiles/core/local_url_handlers.cpp b/Telegram/SourceFiles/core/local_url_handlers.cpp index 2cf4c664f0..f8ffa69897 100644 --- a/Telegram/SourceFiles/core/local_url_handlers.cpp +++ b/Telegram/SourceFiles/core/local_url_handlers.cpp @@ -41,6 +41,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "window/themes/window_theme_editor_box.h" // GenerateSlug. #include "payments/payments_checkout_process.h" #include "settings/settings_common.h" +#include "settings/settings_global_ttl.h" #include "settings/settings_folders.h" #include "settings/settings_main.h" #include "settings/settings_privacy_security.h" @@ -485,6 +486,8 @@ bool ResolveSettings( return ::Settings::Chat::Id(); } else if (section == u"change_number"_q) { return ::Settings::ChangePhone::Id(); + } else if (section == u"auto_delete"_q) { + return ::Settings::GlobalTTLId(); } return ::Settings::Main::Id(); }(); @@ -843,7 +846,7 @@ const std::vector &LocalUrlHandlers() { ResolvePrivatePost }, { - u"^settings(/language|/devices|/folders|/privacy|/themes|/change_number)?$"_q, + u"^settings(/language|/devices|/folders|/privacy|/themes|/change_number|/auto_delete)?$"_q, ResolveSettings }, { diff --git a/Telegram/SourceFiles/menu/menu_ttl.h b/Telegram/SourceFiles/menu/menu_ttl.h index 8d92453ec0..a70f419b54 100644 --- a/Telegram/SourceFiles/menu/menu_ttl.h +++ b/Telegram/SourceFiles/menu/menu_ttl.h @@ -21,7 +21,7 @@ namespace TTLMenu { struct Args { std::shared_ptr show; TimeId startTtl; - rpl::producer about; + rpl::producer about; Fn callback; bool hideDisable = false; }; diff --git a/Telegram/SourceFiles/menu/menu_ttl_validator.cpp b/Telegram/SourceFiles/menu/menu_ttl_validator.cpp index 8fc2631159..93ea0a2276 100644 --- a/Telegram/SourceFiles/menu/menu_ttl_validator.cpp +++ b/Telegram/SourceFiles/menu/menu_ttl_validator.cpp @@ -94,11 +94,24 @@ Args TTLValidator::createArgs() const { }).send(); show->hideLayer(); }; - auto about = peer->isUser() + auto about1 = peer->isUser() ? tr::lng_ttl_edit_about(lt_user, rpl::single(peer->shortName())) : peer->isBroadcast() ? tr::lng_ttl_edit_about_channel() : tr::lng_ttl_edit_about_group(); + auto about2 = tr::lng_ttl_edit_about2( + lt_link, + tr::lng_ttl_edit_about2_link( + ) | rpl::map([=](const QString &s) { + return Ui::Text::Link(s, "tg://settings/auto_delete"); + }), + Ui::Text::WithEntities); + auto about = rpl::combine( + std::move(about1), + std::move(about2) + ) | rpl::map([](const QString &s1, TextWithEntities &&s2) { + return TextWithEntities{ s1 }.append(u"\n\n"_q).append(std::move(s2)); + }); const auto ttl = peer->messagesTTL(); return { std::move(show), ttl, std::move(about), std::move(callback) }; }