diff --git a/td/generate/scheme/td_api.tl b/td/generate/scheme/td_api.tl index 9322e0d7e..a174b2d2b 100644 --- a/td/generate/scheme/td_api.tl +++ b/td/generate/scheme/td_api.tl @@ -4443,9 +4443,12 @@ jsonValueObject members:vector = JsonValue; //@description A rule to allow all users to do something userPrivacySettingRuleAllowAll = UserPrivacySettingRule; -//@description A rule to allow all of a user's contacts to do something +//@description A rule to allow all contacts of the user to do something userPrivacySettingRuleAllowContacts = UserPrivacySettingRule; +//@description A rule to allow all close friends of the user to do something +userPrivacySettingRuleAllowCloseFriends = UserPrivacySettingRule; + //@description A rule to allow certain specified users to do something @user_ids The user identifiers, total number of users in all rules must not exceed 1000 userPrivacySettingRuleAllowUsers user_ids:vector = UserPrivacySettingRule; @@ -4455,7 +4458,7 @@ userPrivacySettingRuleAllowChatMembers chat_ids:vector = UserPrivacySetti //@description A rule to restrict all users from doing something userPrivacySettingRuleRestrictAll = UserPrivacySettingRule; -//@description A rule to restrict all contacts of a user from doing something +//@description A rule to restrict all contacts of the user from doing something userPrivacySettingRuleRestrictContacts = UserPrivacySettingRule; //@description A rule to restrict all specified users from doing something @user_ids The user identifiers, total number of users in all rules must not exceed 1000 diff --git a/td/telegram/PrivacyManager.cpp b/td/telegram/PrivacyManager.cpp index 19199dbd8..03453b2aa 100644 --- a/td/telegram/PrivacyManager.cpp +++ b/td/telegram/PrivacyManager.cpp @@ -197,6 +197,9 @@ PrivacyManager::UserPrivacySettingRule::UserPrivacySettingRule(const td_api::Use case td_api::userPrivacySettingRuleAllowContacts::ID: type_ = Type::AllowContacts; break; + case td_api::userPrivacySettingRuleAllowCloseFriends::ID: + type_ = Type::AllowCloseFriends; + break; case td_api::userPrivacySettingRuleAllowAll::ID: type_ = Type::AllowAll; break; @@ -234,7 +237,7 @@ PrivacyManager::UserPrivacySettingRule::UserPrivacySettingRule(const telegram_ap type_ = Type::AllowContacts; break; case telegram_api::privacyValueAllowCloseFriends::ID: - type_ = Type::AllowContacts; + type_ = Type::AllowCloseFriends; break; case telegram_api::privacyValueAllowAll::ID: type_ = Type::AllowAll; @@ -271,6 +274,8 @@ PrivacyManager::UserPrivacySettingRule::get_user_privacy_setting_rule_object() c switch (type_) { case Type::AllowContacts: return make_tl_object(); + case Type::AllowCloseFriends: + return make_tl_object(); case Type::AllowAll: return make_tl_object(); case Type::AllowUsers: @@ -294,6 +299,8 @@ tl_object_ptr PrivacyManager::UserPrivacySetting switch (type_) { case Type::AllowContacts: return make_tl_object(); + case Type::AllowCloseFriends: + return make_tl_object(); case Type::AllowAll: return make_tl_object(); case Type::AllowUsers: diff --git a/td/telegram/PrivacyManager.h b/td/telegram/PrivacyManager.h index 044212258..2372d2827 100644 --- a/td/telegram/PrivacyManager.h +++ b/td/telegram/PrivacyManager.h @@ -91,6 +91,7 @@ class PrivacyManager final : public NetQueryCallback { private: enum class Type : int32 { AllowContacts, + AllowCloseFriends, AllowAll, AllowUsers, AllowChatParticipants, diff --git a/td/telegram/cli.cpp b/td/telegram/cli.cpp index db8401552..2824d8cc4 100644 --- a/td/telegram/cli.cpp +++ b/td/telegram/cli.cpp @@ -1463,6 +1463,8 @@ class CliClient final : public Actor { vector> rules; if (allow == "c" || allow == "contacts") { rules.push_back(td_api::make_object()); + } else if (allow == "f" || allow == "friends") { + rules.push_back(td_api::make_object()); } else if (allow == "users") { rules.push_back(td_api::make_object(as_user_ids(ids))); } else if (allow == "chats") {