From 0ba15e33dded9fabdebc587b2907d37535873d34 Mon Sep 17 00:00:00 2001 From: levlam Date: Wed, 2 Aug 2023 13:52:33 +0300 Subject: [PATCH] tg_cli: use as_user_ids in StoryPrivacySettings. --- td/telegram/cli.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/td/telegram/cli.cpp b/td/telegram/cli.cpp index 7e39cbca3..bb5da7b6f 100644 --- a/td/telegram/cli.cpp +++ b/td/telegram/cli.cpp @@ -1175,21 +1175,21 @@ class CliClient final : public Actor { struct StoryPrivacySettings { string settings; + vector user_ids; operator td_api::object_ptr() const { 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)); + return td_api::make_object(vector(user_ids)); } if (settings[0] == 'c') { - return td_api::make_object(std::move(user_ids)); + return td_api::make_object(vector(user_ids)); } if (settings[0] == 'u') { - return td_api::make_object(std::move(user_ids)); + return td_api::make_object(vector(user_ids)); } } return td_api::make_object(); @@ -1198,6 +1198,9 @@ class CliClient final : public Actor { void get_args(string &args, StoryPrivacySettings &arg) const { arg.settings = trim(args); + if (!arg.settings.empty() && arg.settings != "cf") { + arg.user_ids = as_user_ids(Slice(arg.settings).substr(1)); + } } template