1
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-03-19 18:05:37 +00:00

Display information about proxy sponsor.

This commit is contained in:
John Preston 2018-05-15 20:22:28 +03:00
parent 5a1d4d55c6
commit 5f063c0151
3 changed files with 20 additions and 1 deletions
Telegram
Resources/langs
SourceFiles/boxes

View File

@ -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";

View File

@ -781,3 +781,4 @@ proxyDropdownDownPosition: point(-2px, 35px);
proxyDropdownUpPosition: point(-2px, 20px);
proxyAboutPadding: margins(22px, 7px, 22px, 14px);
proxyAboutSponsorPadding: margins(22px, 7px, 22px, 0px);

View File

@ -155,6 +155,7 @@ private:
std::shared_ptr<Ui::RadioenumGroup<Type>> _type;
QPointer<Ui::SlideWrap<>> _aboutSponsored;
QPointer<Ui::InputField> _host;
QPointer<Ui::PortInput> _port;
QPointer<Ui::InputField> _user;
@ -763,6 +764,16 @@ void ProxyBox::setupTypes() {
label),
st::proxyEditTypePadding);
}
_aboutSponsored = _content->add(object_ptr<Ui::SlideWrap<>>(
_content,
object_ptr<Ui::PaddingWrap<>>(
_content,
object_ptr<Ui::FlatLabel>(
_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<ConfirmBox>(text, lang(lng_sure_enable), [=] {
auto &proxies = Global::RefProxiesList();
if (ranges::find(proxies, proxy) == end(proxies)) {