Skip to content

Commit

Permalink
Export media sizes
Browse files Browse the repository at this point in the history
  • Loading branch information
anton-ryzhov committed Feb 9, 2025
1 parent bf48025 commit 2e53a7e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Telegram/SourceFiles/export/output/export_output_json.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,7 @@ QByteArray SerializeMessage(
};
const auto pushPhoto = [&](const Image &image) {
pushPath(image.file, "photo");
push("photo_file_size", image.file.size);
if (image.width && image.height) {
push("width", image.width);
push("height", image.height);
Expand Down Expand Up @@ -696,8 +697,10 @@ QByteArray SerializeMessage(
}, [&](const Document &data) {
pushPath(data.file, "file");
push("file_name", data.name);
push("file_size", data.file.size);
if (data.thumb.width > 0) {
pushPath(data.thumb.file, "thumbnail");
push("thumbnail_file_size", data.thumb.file.size);
}
const auto pushType = [&](const QByteArray &value) {
push("media_type", value);
Expand Down Expand Up @@ -739,6 +742,7 @@ QByteArray SerializeMessage(
}));
if (!data.vcard.content.isEmpty()) {
pushPath(data.vcard, "contact_vcard");
push("contact_vcard_file_size", data.vcard.size);
}
}, [&](const GeoPoint &data) {
pushBare(
Expand Down

0 comments on commit 2e53a7e

Please sign in to comment.