Save expected_size for generated locations.

GitOrigin-RevId: f9902ca187bb39936b640106d466878d4a9457ec
This commit is contained in:
levlam 2019-01-01 19:26:36 +03:00
parent eaebfad034
commit 594368e571
2 changed files with 10 additions and 6 deletions

View File

@ -2919,12 +2919,14 @@ class CliClient final : public Actor {
string chat_id;
string photo_path;
string conversion;
string expected_size;
std::tie(chat_id, args) = split(args);
std::tie(photo_path, conversion) = split(args);
std::tie(photo_path, args) = split(args);
std::tie(conversion, expected_size) = split(args);
send_message(chat_id,
make_tl_object<td_api::inputMessagePhoto>(as_generated_file(photo_path, conversion), nullptr,
vector<int32>(), 0, 0, as_caption(""), 0));
send_message(chat_id, make_tl_object<td_api::inputMessagePhoto>(
as_generated_file(photo_path, conversion, to_integer<int32>(expected_size)), nullptr,
vector<int32>(), 0, 0, as_caption(""), 0));
} else if (op == "spt") {
string chat_id;
string photo_path;

View File

@ -91,7 +91,7 @@ void FileManager::store_file(FileId file_id, StorerT &storer, int32 ttl) const {
have_file_id = true;
}
store(generate_location, storer);
store(static_cast<int32>(0), storer); // expected_size
store(static_cast<int32>(file_view.expected_size()), storer);
store(static_cast<int32>(0), storer);
store(file_view.owner_dialog_id(), storer);
@ -100,6 +100,8 @@ void FileManager::store_file(FileId file_id, StorerT &storer, int32 ttl) const {
}
break;
}
default:
UNREACHABLE();
}
if (has_encryption_key) {
store(file_view.encryption_key(), storer);
@ -175,7 +177,7 @@ FileId FileManager::parse_file(ParserT &parser) {
FullGenerateFileLocation full_generated_location;
parse(full_generated_location, parser);
int32 expected_size;
parse(expected_size, parser); // expected_size
parse(expected_size, parser);
int32 zero;
parse(zero, parser);
DialogId owner_dialog_id;