mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-09-01 06:55:58 +00:00
Add gifts-to-profile privacy.
This commit is contained in:
@@ -185,16 +185,23 @@ QString PrivacyBase(Privacy::Key key, const Privacy::Rule &rule) {
|
||||
[[fallthrough]];
|
||||
default:
|
||||
switch (rule.option) {
|
||||
case Option::Everyone: return tr::lng_edit_privacy_everyone(tr::now);
|
||||
case Option::Everyone:
|
||||
return rule.never.miniapps
|
||||
? tr::lng_edit_privacy_no_miniapps(tr::now)
|
||||
: tr::lng_edit_privacy_everyone(tr::now);
|
||||
case Option::Contacts:
|
||||
return rule.always.premiums
|
||||
? tr::lng_edit_privacy_contacts_and_premium(tr::now)
|
||||
: rule.always.miniapps
|
||||
? tr::lng_edit_privacy_contacts_and_miniapps(tr::now)
|
||||
: tr::lng_edit_privacy_contacts(tr::now);
|
||||
case Option::CloseFriends:
|
||||
return tr::lng_edit_privacy_close_friends(tr::now);
|
||||
case Option::Nobody:
|
||||
return rule.always.premiums
|
||||
? tr::lng_edit_privacy_premium(tr::now)
|
||||
: rule.always.miniapps
|
||||
? tr::lng_edit_privacy_miniapps(tr::now)
|
||||
: tr::lng_edit_privacy_nobody(tr::now);
|
||||
}
|
||||
Unexpected("Value in Privacy::Option.");
|
||||
@@ -405,7 +412,8 @@ void SetupPrivacy(
|
||||
add(
|
||||
tr::lng_settings_last_seen(),
|
||||
Key::LastSeen,
|
||||
[=] { return std::make_unique<LastSeenPrivacyController>(session); });
|
||||
[=] { return std::make_unique<LastSeenPrivacyController>(
|
||||
session); });
|
||||
add(
|
||||
tr::lng_settings_profile_photo_privacy(),
|
||||
Key::ProfilePhoto,
|
||||
@@ -414,6 +422,10 @@ void SetupPrivacy(
|
||||
tr::lng_settings_bio_privacy(),
|
||||
Key::About,
|
||||
[] { return std::make_unique<AboutPrivacyController>(); });
|
||||
add(
|
||||
tr::lng_settings_gifts_privacy(),
|
||||
Key::GiftsAutoSave,
|
||||
[=] { return std::make_unique<GiftsAutoSavePrivacyController>(); });
|
||||
add(
|
||||
tr::lng_settings_birthday_privacy(),
|
||||
Key::Birthday,
|
||||
@@ -442,7 +454,8 @@ void SetupPrivacy(
|
||||
}
|
||||
AddMessagesPrivacyButton(controller, container);
|
||||
|
||||
session->api().userPrivacy().reload(Api::UserPrivacy::Key::AddedByPhone);
|
||||
session->api().userPrivacy().reload(
|
||||
Api::UserPrivacy::Key::AddedByPhone);
|
||||
|
||||
Ui::AddSkip(container, st::settingsPrivacySecurityPadding);
|
||||
Ui::AddDivider(container);
|
||||
|
Reference in New Issue
Block a user