From 15e0786632f6d96558f8eec0ccdd5f3d6872d411 Mon Sep 17 00:00:00 2001 From: levlam Date: Sat, 16 Jul 2022 21:20:18 +0300 Subject: [PATCH] Add userPrivacySettingAllowPrivateVoiceAndVideoNoteMessages. --- td/generate/scheme/td_api.tl | 3 +++ td/telegram/PrivacyManager.cpp | 9 ++++++++- td/telegram/PrivacyManager.h | 1 + 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/td/generate/scheme/td_api.tl b/td/generate/scheme/td_api.tl index 7c4c6c8ce..dbf203302 100644 --- a/td/generate/scheme/td_api.tl +++ b/td/generate/scheme/td_api.tl @@ -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; diff --git a/td/telegram/PrivacyManager.cpp b/td/telegram/PrivacyManager.cpp index d1013c5f1..2874dec91 100644 --- a/td/telegram/PrivacyManager.cpp +++ b/td/telegram/PrivacyManager.cpp @@ -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 PrivacyManager::UserPrivacySetting::ge return make_tl_object(); case Type::FindByPhoneNumber: return make_tl_object(); + case Type::VoiceMessages: + return make_tl_object(); default: UNREACHABLE(); return nullptr; @@ -108,6 +110,8 @@ tl_object_ptr PrivacyManager::UserPrivacySetting: return make_tl_object(); case Type::FindByPhoneNumber: return make_tl_object(); + case Type::VoiceMessages: + return make_tl_object(); 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; diff --git a/td/telegram/PrivacyManager.h b/td/telegram/PrivacyManager.h index 2632f5ff7..18d81bd6c 100644 --- a/td/telegram/PrivacyManager.h +++ b/td/telegram/PrivacyManager.h @@ -47,6 +47,7 @@ class PrivacyManager final : public NetQueryCallback { UserProfilePhoto, UserPhoneNumber, FindByPhoneNumber, + VoiceMessages, Size };