From b456895f5bfc9c5364731b3947a41c3ddcae396c Mon Sep 17 00:00:00 2001 From: levlam Date: Sun, 18 Mar 2018 13:45:59 +0300 Subject: [PATCH] tg_cli: "skip" generation conversion. GitOrigin-RevId: 85aacd4c915c07ba37a57eac0658bc6288198b32 --- td/telegram/cli.cpp | 2 ++ td/telegram/files/FileManager.cpp | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/td/telegram/cli.cpp b/td/telegram/cli.cpp index fec708698..b4d28a72f 100644 --- a/td/telegram/cli.cpp +++ b/td/telegram/cli.cpp @@ -345,6 +345,8 @@ class CliClient final : public Actor { // TODO: actually download file_generation.source = "test.jpg"; file_generation.part_size = 1000000; + } else if (update.conversion_ == "skip") { + return; } else { file_generation.source = update.original_path_; file_generation.part_size = to_integer(update.conversion_); diff --git a/td/telegram/files/FileManager.cpp b/td/telegram/files/FileManager.cpp index d8dc46200..3a4be77bb 100644 --- a/td/telegram/files/FileManager.cpp +++ b/td/telegram/files/FileManager.cpp @@ -1589,7 +1589,7 @@ void FileManager::run_generate(FileNodePtr node) { int8 download_priority = 0; int8 upload_priority = 0; - FileId file_id; + FileId file_id = node->main_file_id_; for (auto id : node->file_ids_) { auto *info = get_file_id_info(id); if (info->download_priority_ > download_priority) { @@ -1664,7 +1664,7 @@ void FileManager::run_upload(FileNodePtr node, std::vector bad_parts) { } } int8 priority = 0; - FileId file_id; + FileId file_id = node->main_file_id_; for (auto id : node->file_ids_) { auto *info = get_file_id_info(id); if (info->upload_priority_ > priority) {