Add userPrivacySettingAllowPrivateVoiceAndVideoNoteMessages.

This commit is contained in:
levlam 2022-07-16 21:20:18 +03:00
parent 32c7bd8bcd
commit 15e0786632
3 changed files with 12 additions and 1 deletions

View File

@ -3469,6 +3469,9 @@ userPrivacySettingAllowPeerToPeerCalls = UserPrivacySetting;
//@description A privacy setting for managing whether the user can be found by their phone number. Checked only if the phone number is not known to the other user. Can be set only to "Allow contacts" or "Allow all"
userPrivacySettingAllowFindingByPhoneNumber = UserPrivacySetting;
//@description A privacy setting for managing whether the user can receive voice and video messages in private chats
userPrivacySettingAllowPrivateVoiceAndVideoNoteMessages = UserPrivacySetting;
//@description Contains information about the period of inactivity after which the current user's account will automatically be deleted @days Number of days of inactivity before the account will be flagged for deletion; 30-366 days
accountTtl days:int32 = AccountTtl;

View File

@ -59,7 +59,7 @@ PrivacyManager::UserPrivacySetting::UserPrivacySetting(const telegram_api::Priva
type_ = Type::FindByPhoneNumber;
break;
case telegram_api::privacyKeyVoiceMessages::ID:
type_ = Type::UserStatus; // TODO
type_ = Type::VoiceMessages;
break;
default:
UNREACHABLE();
@ -85,6 +85,8 @@ tl_object_ptr<td_api::UserPrivacySetting> PrivacyManager::UserPrivacySetting::ge
return make_tl_object<td_api::userPrivacySettingShowPhoneNumber>();
case Type::FindByPhoneNumber:
return make_tl_object<td_api::userPrivacySettingAllowFindingByPhoneNumber>();
case Type::VoiceMessages:
return make_tl_object<td_api::userPrivacySettingAllowPrivateVoiceAndVideoNoteMessages>();
default:
UNREACHABLE();
return nullptr;
@ -108,6 +110,8 @@ tl_object_ptr<telegram_api::InputPrivacyKey> PrivacyManager::UserPrivacySetting:
return make_tl_object<telegram_api::inputPrivacyKeyPhoneNumber>();
case Type::FindByPhoneNumber:
return make_tl_object<telegram_api::inputPrivacyKeyAddedByPhone>();
case Type::VoiceMessages:
return make_tl_object<telegram_api::inputPrivacyKeyVoiceMessages>();
default:
UNREACHABLE();
return nullptr;
@ -140,6 +144,9 @@ PrivacyManager::UserPrivacySetting::UserPrivacySetting(const td_api::UserPrivacy
case td_api::userPrivacySettingAllowFindingByPhoneNumber::ID:
type_ = Type::FindByPhoneNumber;
break;
case td_api::userPrivacySettingAllowPrivateVoiceAndVideoNoteMessages::ID:
type_ = Type::VoiceMessages;
break;
default:
UNREACHABLE();
type_ = Type::UserStatus;

View File

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