Add privacy setting for bio.

This commit is contained in:
levlam 2023-05-04 17:03:37 +03:00
parent f733cb56ce
commit 10338c0490
4 changed files with 15 additions and 1 deletions

View File

@ -4465,6 +4465,9 @@ userPrivacySettingShowLinkInForwardedMessages = UserPrivacySetting;
//@description A privacy setting for managing whether the user's phone number is visible
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 can be invited to chats
userPrivacySettingAllowChatInvites = UserPrivacySetting;

View File

@ -62,7 +62,7 @@ PrivacyManager::UserPrivacySetting::UserPrivacySetting(const telegram_api::Priva
type_ = Type::VoiceMessages;
break;
case telegram_api::privacyKeyAbout::ID:
type_ = Type::VoiceMessages;
type_ = Type::UserBio;
break;
default:
UNREACHABLE();
@ -90,6 +90,8 @@ tl_object_ptr<td_api::UserPrivacySetting> PrivacyManager::UserPrivacySetting::ge
return make_tl_object<td_api::userPrivacySettingAllowFindingByPhoneNumber>();
case Type::VoiceMessages:
return make_tl_object<td_api::userPrivacySettingAllowPrivateVoiceAndVideoNoteMessages>();
case Type::UserBio:
return make_tl_object<td_api::userPrivacySettingShowBio>();
default:
UNREACHABLE();
return nullptr;
@ -115,6 +117,8 @@ tl_object_ptr<telegram_api::InputPrivacyKey> PrivacyManager::UserPrivacySetting:
return make_tl_object<telegram_api::inputPrivacyKeyAddedByPhone>();
case Type::VoiceMessages:
return make_tl_object<telegram_api::inputPrivacyKeyVoiceMessages>();
case Type::UserBio:
return make_tl_object<telegram_api::inputPrivacyKeyAbout>();
default:
UNREACHABLE();
return nullptr;
@ -150,6 +154,9 @@ PrivacyManager::UserPrivacySetting::UserPrivacySetting(const td_api::UserPrivacy
case td_api::userPrivacySettingAllowPrivateVoiceAndVideoNoteMessages::ID:
type_ = Type::VoiceMessages;
break;
case td_api::userPrivacySettingShowBio::ID:
type_ = Type::UserBio;
break;
default:
UNREACHABLE();
type_ = Type::UserStatus;

View File

@ -48,6 +48,7 @@ class PrivacyManager final : public NetQueryCallback {
UserPhoneNumber,
FindByPhoneNumber,
VoiceMessages,
UserBio,
Size
};

View File

@ -1450,6 +1450,9 @@ class CliClient final : public Actor {
if (setting == "phone_number") {
return td_api::make_object<td_api::userPrivacySettingShowPhoneNumber>();
}
if (setting == "bio") {
return td_api::make_object<td_api::userPrivacySettingShowBio>();
}
if (setting == "find") {
return td_api::make_object<td_api::userPrivacySettingAllowFindingByPhoneNumber>();
}