diff --git a/td/telegram/cli.cpp b/td/telegram/cli.cpp index 27e3b2ef..ef6b0bc7 100644 --- a/td/telegram/cli.cpp +++ b/td/telegram/cli.cpp @@ -2861,12 +2861,16 @@ class CliClient final : public Actor { send_message(chat_id, make_tl_object( as_local_file(document_path), as_input_thumbnail(as_local_file(thumbnail_path)), as_caption("test caption"))); - } else if (op == "sdg") { + } else if (op == "sdg" || op == "sdgu") { string chat_id; string document_path; string document_conversion; std::tie(chat_id, args) = split(args); std::tie(document_path, document_conversion) = split(args); + if (op == "sdgu") { + send_request( + make_tl_object(as_generated_file(document_path, document_conversion), nullptr, 1)); + } send_message(chat_id, make_tl_object(as_generated_file(document_path, document_conversion), nullptr, as_caption("test caption"))); diff --git a/td/telegram/files/FileGenerateManager.h b/td/telegram/files/FileGenerateManager.h index f153d0cd..48e82c62 100644 --- a/td/telegram/files/FileGenerateManager.h +++ b/td/telegram/files/FileGenerateManager.h @@ -16,6 +16,7 @@ #include namespace td { + class FileGenerateActor; class FileGenerateCallback { diff --git a/td/telegram/files/FileManager.cpp b/td/telegram/files/FileManager.cpp index 3d11939c..45201539 100644 --- a/td/telegram/files/FileManager.cpp +++ b/td/telegram/files/FileManager.cpp @@ -972,9 +972,11 @@ static int merge_choose_generate_location(const unique_ptrconversion_ >= y->conversion_ - ? 0 - : 1; // the bigger conversion, the bigger mtime or at least more stable choise + if (x->conversion_ != y->conversion) { + return x->conversion_ >= y->conversion_ + ? 0 + : 1; // the bigger conversion, the bigger mtime or at least more stable choise + } } return 2; }