diff --git a/td/generate/scheme/td_api.tl b/td/generate/scheme/td_api.tl index 15f05705a..d3d2c3d94 100644 --- a/td/generate/scheme/td_api.tl +++ b/td/generate/scheme/td_api.tl @@ -4497,16 +4497,16 @@ jsonValueObject members:vector = JsonValue; //@class StoryPrivacySettings @description Describes privacy settings of a story -//@description The story can be viewed by everyone -storyPrivacySettingsEveryone = StoryPrivacySettings; +//@description The story can be viewed by everyone @except_user_ids Identifiers of the users that can't see the story; always unknown and empty for non-owned stories +storyPrivacySettingsEveryone except_user_ids:vector = StoryPrivacySettings; -//@description The story can be viewed by all contacts except chosen users @except_user_ids User identifiers of the contacts that can't see the story; always empty for non-owned stories +//@description The story can be viewed by all contacts except chosen users @except_user_ids User identifiers of the contacts that can't see the story; always unknown and empty for non-owned stories storyPrivacySettingsContacts except_user_ids:vector = StoryPrivacySettings; //@description The story can be viewed by all close friends storyPrivacySettingsCloseFriends = StoryPrivacySettings; -//@description The story can be viewed by certain specified users @user_ids Identifiers of the users; always empty for non-owned stories +//@description The story can be viewed by certain specified users @user_ids Identifiers of the users; always unknown and empty for non-owned stories storyPrivacySettingsSelectedContacts user_ids:vector = StoryPrivacySettings; diff --git a/td/telegram/UserPrivacySettingRule.cpp b/td/telegram/UserPrivacySettingRule.cpp index a46f174fc..eb5561d96 100644 --- a/td/telegram/UserPrivacySettingRule.cpp +++ b/td/telegram/UserPrivacySettingRule.cpp @@ -295,9 +295,14 @@ Result UserPrivacySettingRules::get_user_privacy_settin } UserPrivacySettingRules result; switch (settings->get_id()) { - case td_api::storyPrivacySettingsEveryone::ID: + case td_api::storyPrivacySettingsEveryone::ID: { + auto user_ids = std::move(static_cast(*settings).except_user_ids_); + if (!user_ids.empty()) { + result.rules_.emplace_back(td, td_api::userPrivacySettingRuleRestrictUsers(std::move(user_ids))); + } result.rules_.emplace_back(td, td_api::userPrivacySettingRuleAllowAll()); break; + } case td_api::storyPrivacySettingsContacts::ID: { auto user_ids = std::move(static_cast(*settings).except_user_ids_); if (!user_ids.empty()) { @@ -337,6 +342,11 @@ td_api::object_ptr UserPrivacySettingRules::get_st if (rules_.size() == 1u && rules_[0].type_ == UserPrivacySettingRule::Type::AllowAll) { return td_api::make_object(); } + if (rules_.size() == 2u && rules_[0].type_ == UserPrivacySettingRule::Type::RestrictUsers && + rules_[1].type_ == UserPrivacySettingRule::Type::AllowAll) { + return td_api::make_object( + td->contacts_manager_->get_user_ids_object(rules_[0].user_ids_, "storyPrivacySettingsEveryone")); + } if (rules_.size() == 1u && rules_[0].type_ == UserPrivacySettingRule::Type::AllowContacts) { return td_api::make_object(); } diff --git a/td/telegram/cli.cpp b/td/telegram/cli.cpp index 8b4ea397c..7e39cbca3 100644 --- a/td/telegram/cli.cpp +++ b/td/telegram/cli.cpp @@ -1177,14 +1177,14 @@ class CliClient final : public Actor { string settings; operator td_api::object_ptr() const { - if (settings == "a" || settings == "e") { - return td_api::make_object(); - } if (settings == "f" || settings == "cf") { return td_api::make_object(); } if (!settings.empty()) { auto user_ids = to_integers(Slice(settings).substr(1)); + if (settings[0] == 'a' || settings[0] == 'e') { + return td_api::make_object(std::move(user_ids)); + } if (settings[0] == 'c') { return td_api::make_object(std::move(user_ids)); }