Fix merge_choose_generate_location.
GitOrigin-RevId: 811ba253ffab93da2894d8792186b077e8ab3156
This commit is contained in:
parent
0fc836ce8f
commit
c47b737ef7
@ -2861,12 +2861,16 @@ class CliClient final : public Actor {
|
|||||||
send_message(chat_id, make_tl_object<td_api::inputMessageDocument>(
|
send_message(chat_id, make_tl_object<td_api::inputMessageDocument>(
|
||||||
as_local_file(document_path), as_input_thumbnail(as_local_file(thumbnail_path)),
|
as_local_file(document_path), as_input_thumbnail(as_local_file(thumbnail_path)),
|
||||||
as_caption("test caption")));
|
as_caption("test caption")));
|
||||||
} else if (op == "sdg") {
|
} else if (op == "sdg" || op == "sdgu") {
|
||||||
string chat_id;
|
string chat_id;
|
||||||
string document_path;
|
string document_path;
|
||||||
string document_conversion;
|
string document_conversion;
|
||||||
std::tie(chat_id, args) = split(args);
|
std::tie(chat_id, args) = split(args);
|
||||||
std::tie(document_path, document_conversion) = split(args);
|
std::tie(document_path, document_conversion) = split(args);
|
||||||
|
if (op == "sdgu") {
|
||||||
|
send_request(
|
||||||
|
make_tl_object<td_api::uploadFile>(as_generated_file(document_path, document_conversion), nullptr, 1));
|
||||||
|
}
|
||||||
send_message(chat_id,
|
send_message(chat_id,
|
||||||
make_tl_object<td_api::inputMessageDocument>(as_generated_file(document_path, document_conversion),
|
make_tl_object<td_api::inputMessageDocument>(as_generated_file(document_path, document_conversion),
|
||||||
nullptr, as_caption("test caption")));
|
nullptr, as_caption("test caption")));
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
namespace td {
|
namespace td {
|
||||||
|
|
||||||
class FileGenerateActor;
|
class FileGenerateActor;
|
||||||
|
|
||||||
class FileGenerateCallback {
|
class FileGenerateCallback {
|
||||||
|
@ -972,9 +972,11 @@ static int merge_choose_generate_location(const unique_ptr<FullGenerateFileLocat
|
|||||||
if (x_has_mtime != y_has_mtime) {
|
if (x_has_mtime != y_has_mtime) {
|
||||||
return x_has_mtime ? 0 : 1;
|
return x_has_mtime ? 0 : 1;
|
||||||
}
|
}
|
||||||
return x->conversion_ >= y->conversion_
|
if (x->conversion_ != y->conversion) {
|
||||||
? 0
|
return x->conversion_ >= y->conversion_
|
||||||
: 1; // the bigger conversion, the bigger mtime or at least more stable choise
|
? 0
|
||||||
|
: 1; // the bigger conversion, the bigger mtime or at least more stable choise
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user