Add bio privacy section.
This commit is contained in:
parent
8b22f9dcac
commit
e90642f3a0
|
@ -584,6 +584,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
"lng_settings_forwards_privacy" = "Forwarded messages";
|
"lng_settings_forwards_privacy" = "Forwarded messages";
|
||||||
"lng_settings_profile_photo_privacy" = "Profile photo";
|
"lng_settings_profile_photo_privacy" = "Profile photo";
|
||||||
"lng_settings_voices_privacy" = "Voice messages";
|
"lng_settings_voices_privacy" = "Voice messages";
|
||||||
|
"lng_settings_bio_privacy" = "Bio";
|
||||||
"lng_settings_privacy_premium" = "Only subscribers of {link} can restrict receiving voice messages.";
|
"lng_settings_privacy_premium" = "Only subscribers of {link} can restrict receiving voice messages.";
|
||||||
"lng_settings_privacy_premium_link" = "Telegram Premium";
|
"lng_settings_privacy_premium_link" = "Telegram Premium";
|
||||||
"lng_settings_passcode_disable" = "Disable Passcode";
|
"lng_settings_passcode_disable" = "Disable Passcode";
|
||||||
|
@ -999,6 +1000,14 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
"lng_edit_privacy_groups_always_title" = "Always allow";
|
"lng_edit_privacy_groups_always_title" = "Always allow";
|
||||||
"lng_edit_privacy_groups_never_title" = "Never allow";
|
"lng_edit_privacy_groups_never_title" = "Never allow";
|
||||||
|
|
||||||
|
"lng_edit_privacy_about_title" = "Bio privacy settings";
|
||||||
|
"lng_edit_privacy_about_header" = "Who can see my bio";
|
||||||
|
"lng_edit_privacy_about_always_empty" = "Always allow";
|
||||||
|
"lng_edit_privacy_about_never_empty" = "Never allow";
|
||||||
|
"lng_edit_privacy_about_exceptions" = "These users will or will not be able to see your profile bio regardless of the settings above.";
|
||||||
|
"lng_edit_privacy_about_always_title" = "Always allow";
|
||||||
|
"lng_edit_privacy_about_never_title" = "Never allow";
|
||||||
|
|
||||||
"lng_edit_privacy_calls_title" = "Voice calls privacy";
|
"lng_edit_privacy_calls_title" = "Voice calls privacy";
|
||||||
"lng_edit_privacy_calls_header" = "Who can call you";
|
"lng_edit_privacy_calls_header" = "Who can call you";
|
||||||
"lng_edit_privacy_calls_always_empty" = "Always allow";
|
"lng_edit_privacy_calls_always_empty" = "Always allow";
|
||||||
|
|
|
@ -1284,4 +1284,39 @@ auto VoicesPrivacyController::exceptionsDescription() const
|
||||||
return tr::lng_edit_privacy_voices_exceptions();
|
return tr::lng_edit_privacy_voices_exceptions();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
UserPrivacy::Key AboutPrivacyController::key() const {
|
||||||
|
return Key::About;
|
||||||
|
}
|
||||||
|
|
||||||
|
rpl::producer<QString> AboutPrivacyController::title() const {
|
||||||
|
return tr::lng_edit_privacy_about_title();
|
||||||
|
}
|
||||||
|
|
||||||
|
rpl::producer<QString> AboutPrivacyController::optionsTitleKey() const {
|
||||||
|
return tr::lng_edit_privacy_about_header();
|
||||||
|
}
|
||||||
|
|
||||||
|
rpl::producer<QString> AboutPrivacyController::exceptionButtonTextKey(
|
||||||
|
Exception exception) const {
|
||||||
|
switch (exception) {
|
||||||
|
case Exception::Always: return tr::lng_edit_privacy_about_always_empty();
|
||||||
|
case Exception::Never: return tr::lng_edit_privacy_about_never_empty();
|
||||||
|
}
|
||||||
|
Unexpected("Invalid exception value.");
|
||||||
|
}
|
||||||
|
|
||||||
|
rpl::producer<QString> AboutPrivacyController::exceptionBoxTitle(
|
||||||
|
Exception exception) const {
|
||||||
|
switch (exception) {
|
||||||
|
case Exception::Always: return tr::lng_edit_privacy_about_always_title();
|
||||||
|
case Exception::Never: return tr::lng_edit_privacy_about_never_title();
|
||||||
|
}
|
||||||
|
Unexpected("Invalid exception value.");
|
||||||
|
}
|
||||||
|
|
||||||
|
auto AboutPrivacyController::exceptionsDescription() const
|
||||||
|
-> rpl::producer<QString> {
|
||||||
|
return tr::lng_edit_privacy_about_exceptions();
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace Settings
|
} // namespace Settings
|
||||||
|
|
|
@ -270,4 +270,21 @@ private:
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class AboutPrivacyController final : public EditPrivacyController {
|
||||||
|
public:
|
||||||
|
using Option = EditPrivacyBox::Option;
|
||||||
|
using Exception = EditPrivacyBox::Exception;
|
||||||
|
|
||||||
|
Key key() const override;
|
||||||
|
|
||||||
|
rpl::producer<QString> title() const override;
|
||||||
|
rpl::producer<QString> optionsTitleKey() const override;
|
||||||
|
rpl::producer<QString> exceptionButtonTextKey(
|
||||||
|
Exception exception) const override;
|
||||||
|
rpl::producer<QString> exceptionBoxTitle(
|
||||||
|
Exception exception) const override;
|
||||||
|
rpl::producer<QString> exceptionsDescription() const override;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
} // namespace Settings
|
} // namespace Settings
|
||||||
|
|
|
@ -310,6 +310,11 @@ void SetupPrivacy(
|
||||||
{ &st::settingsPremiumIconVoice, kIconRed },
|
{ &st::settingsPremiumIconVoice, kIconRed },
|
||||||
Key::Voices,
|
Key::Voices,
|
||||||
[=] { return std::make_unique<VoicesPrivacyController>(session); });
|
[=] { return std::make_unique<VoicesPrivacyController>(session); });
|
||||||
|
add(
|
||||||
|
tr::lng_settings_bio_privacy(),
|
||||||
|
{ &st::settingsIconAccount, kIconDarkOrange },
|
||||||
|
Key::About,
|
||||||
|
[] { return std::make_unique<AboutPrivacyController>(); });
|
||||||
|
|
||||||
session->api().userPrivacy().reload(Api::UserPrivacy::Key::AddedByPhone);
|
session->api().userPrivacy().reload(Api::UserPrivacy::Key::AddedByPhone);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user