diff --git a/td/telegram/cli.cpp b/td/telegram/cli.cpp index daa2d8280..c7e4ae131 100644 --- a/td/telegram/cli.cpp +++ b/td/telegram/cli.cpp @@ -2352,7 +2352,7 @@ class CliClient final : public Actor { send_request(make_tl_object( as_location(latitude, longitude), to_integer(zoom), to_integer(width), to_integer(height), to_integer(scale), as_chat_id(chat_id))); - } else if (op == "df" || op == "DownloadFile") { + } else if (op == "df" || op == "DownloadFile" || op == "dff") { string file_id; string priority; string offset; @@ -2364,21 +2364,9 @@ class CliClient final : public Actor { priority = "1"; } - send_request(make_tl_object(as_file_id(file_id), to_integer(priority), - to_integer(offset), to_integer(limit))); - } else if (op == "dff") { - string max_file_id; - string priority; - string offset; - string limit; - std::tie(max_file_id, args) = split(args); - std::tie(offset, args) = split(args); - std::tie(limit, priority) = split(args); - if (priority.empty()) { - priority = "1"; - } - - for (int i = 1; i <= as_file_id(max_file_id); i++) { + int32 max_file_id = as_file_id(file_id); + int32 min_file_id = (op == "dff" ? 1 : max_file_id); + for (int32 i = min_file_id; i <= max_file_id; i++) { send_request(make_tl_object(i, to_integer(priority), to_integer(offset), to_integer(limit))); }