From cdb36baa855c9f86862d0baf78a49fedc0197228 Mon Sep 17 00:00:00 2001 From: levlam Date: Thu, 25 May 2023 21:10:02 +0300 Subject: [PATCH] tg_cli: improve story sending. --- 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 74dc5f90a..cace42b03 100644 --- a/td/telegram/cli.cpp +++ b/td/telegram/cli.cpp @@ -1098,6 +1098,9 @@ class CliClient final : public Actor { void get_args(string &args, PrivacyRules &arg) const { arg.rules_str = trim(args); + if (arg.rules_str.empty()) { + arg.rules_str = "a"; + } } template @@ -3928,7 +3931,7 @@ class CliClient final : public Actor { send_request(td_api::make_object(as_chat_list(op), as_chat_ids(args))); } else if (op == "rcl" || op == "rcla" || begins_with(op, "rcl-")) { send_request(td_api::make_object(as_chat_list(op))); - } else if (op == "ssp") { + } else if (op == "ssp" || op == "sspp") { string photo; string caption; PrivacyRules rules; @@ -3937,8 +3940,8 @@ class CliClient final : public Actor { send_request( td_api::make_object(td_api::make_object( as_input_file(photo), to_integers(sticker_file_ids)), - as_caption(caption), rules, true)); - } else if (op == "ssv") { + as_caption(caption), rules, op == "sspp")); + } else if (op == "ssv" || op == "ssvp") { string video; string caption; PrivacyRules rules; @@ -3948,7 +3951,7 @@ class CliClient final : public Actor { send_request(td_api::make_object( td_api::make_object(as_input_file(video), to_integers(sticker_file_ids), duration), - as_caption(caption), rules, false)); + as_caption(caption), rules, op == "ssvp")); } else if (op == "sspr") { StoryId story_id; PrivacyRules rules;