diff --git a/Telegram/Resources/langs/lang.strings b/Telegram/Resources/langs/lang.strings index c237409227..07873018b9 100644 --- a/Telegram/Resources/langs/lang.strings +++ b/Telegram/Resources/langs/lang.strings @@ -444,6 +444,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "lng_proxy_description" = "Your saved proxy list will be here."; "lng_proxy_sponsor" = "Proxy sponsor"; "lng_proxy_sponsor_about" = "This channel is shown by your proxy server.\nTo remove this channel from your chats list,\ndisable the proxy in Telegram Settings."; +"lng_proxy_sponsor_warning" = "This proxy may display a sponsored channel in your chat list. This doesn't reveal any of your Telegram traffic."; "lng_settings_blocked_users" = "Blocked users"; "lng_settings_last_seen_privacy" = "Last seen privacy"; diff --git a/Telegram/SourceFiles/boxes/boxes.style b/Telegram/SourceFiles/boxes/boxes.style index de5b576fe5..6a0fd27307 100644 --- a/Telegram/SourceFiles/boxes/boxes.style +++ b/Telegram/SourceFiles/boxes/boxes.style @@ -781,3 +781,4 @@ proxyDropdownDownPosition: point(-2px, 35px); proxyDropdownUpPosition: point(-2px, 20px); proxyAboutPadding: margins(22px, 7px, 22px, 14px); +proxyAboutSponsorPadding: margins(22px, 7px, 22px, 0px); diff --git a/Telegram/SourceFiles/boxes/connection_box.cpp b/Telegram/SourceFiles/boxes/connection_box.cpp index 871d5c1c6a..004b661786 100644 --- a/Telegram/SourceFiles/boxes/connection_box.cpp +++ b/Telegram/SourceFiles/boxes/connection_box.cpp @@ -155,6 +155,7 @@ private: std::shared_ptr> _type; + QPointer> _aboutSponsored; QPointer _host; QPointer _port; QPointer _user; @@ -763,6 +764,16 @@ void ProxyBox::setupTypes() { label), st::proxyEditTypePadding); } + _aboutSponsored = _content->add(object_ptr>( + _content, + object_ptr>( + _content, + object_ptr( + _content, + lang(lng_proxy_sponsor_warning), + Ui::FlatLabel::InitType::Simple, + st::boxDividerLabel), + st::proxyAboutSponsorPadding))); } void ProxyBox::setupSocketAddress(const ProxyData &data) { @@ -875,6 +886,9 @@ void ProxyBox::setupControls(const ProxyData &data) { _mtprotoCredentials->toggle( type == Type::Mtproto, anim::type::instant); + _aboutSponsored->toggle( + type == Type::Mtproto, + anim::type::instant); }; _type->setChangedCallback([=](Type type) { handleType(type); @@ -1046,7 +1060,10 @@ void ProxiesBoxController::ShowApplyConfirmation( lt_server, server, lt_port, - QString::number(port)); + QString::number(port)) + + (proxy.type == Type::Mtproto + ? "\n\n" + lang(lng_proxy_sponsor_warning) + : QString()); *box = Ui::show(Box(text, lang(lng_sure_enable), [=] { auto &proxies = Global::RefProxiesList(); if (ranges::find(proxies, proxy) == end(proxies)) {