Add td_api::userPrivacySettingShowBirthdate.

This commit is contained in:
levlam 2024-03-21 14:35:27 +03:00
parent ee2bdcfd1d
commit f57e2a496f
3 changed files with 12 additions and 1 deletions

View File

@ -5570,6 +5570,9 @@ userPrivacySettingShowPhoneNumber = UserPrivacySetting;
//@description A privacy setting for managing whether the user's bio is visible
userPrivacySettingShowBio = UserPrivacySetting;
//@description A privacy setting for managing whether the user's birthdate is visible
userPrivacySettingShowBirthdate = UserPrivacySetting;
//@description A privacy setting for managing whether the user can be invited to chats
userPrivacySettingAllowChatInvites = UserPrivacySetting;

View File

@ -49,7 +49,7 @@ UserPrivacySetting::UserPrivacySetting(const telegram_api::PrivacyKey &key) {
type_ = Type::UserBio;
break;
case telegram_api::privacyKeyBirthday::ID:
type_ = Type::UserBio;
type_ = Type::UserBirthdate;
break;
default:
UNREACHABLE();
@ -79,6 +79,8 @@ td_api::object_ptr<td_api::UserPrivacySetting> UserPrivacySetting::get_user_priv
return make_tl_object<td_api::userPrivacySettingAllowPrivateVoiceAndVideoNoteMessages>();
case Type::UserBio:
return make_tl_object<td_api::userPrivacySettingShowBio>();
case Type::UserBirthdate:
return make_tl_object<td_api::userPrivacySettingShowBirthdate>();
default:
UNREACHABLE();
return nullptr;
@ -106,6 +108,8 @@ telegram_api::object_ptr<telegram_api::InputPrivacyKey> UserPrivacySetting::get_
return make_tl_object<telegram_api::inputPrivacyKeyVoiceMessages>();
case Type::UserBio:
return make_tl_object<telegram_api::inputPrivacyKeyAbout>();
case Type::UserBirthdate:
return make_tl_object<telegram_api::inputPrivacyKeyBirthday>();
default:
UNREACHABLE();
return nullptr;
@ -144,6 +148,9 @@ UserPrivacySetting::UserPrivacySetting(const td_api::UserPrivacySetting &key) {
case td_api::userPrivacySettingShowBio::ID:
type_ = Type::UserBio;
break;
case td_api::userPrivacySettingShowBirthdate::ID:
type_ = Type::UserBirthdate;
break;
default:
UNREACHABLE();
type_ = Type::UserStatus;

View File

@ -27,6 +27,7 @@ class UserPrivacySetting {
FindByPhoneNumber,
VoiceMessages,
UserBio,
UserBirthdate,
Size
};