Update API scheme to layer 143.

This commit is contained in:
John Preston
2022-05-10 18:22:28 +04:00
parent dd05fb4d14
commit 6dedf7c63e
81 changed files with 595 additions and 458 deletions
@@ -75,7 +75,7 @@ struct PreparedFile {
QString path;
QByteArray content;
int size = 0;
int64 size = 0;
std::unique_ptr<Ui::PreparedFileInformation> information;
QImage preview;
QSize shownDimensions;
@@ -91,6 +91,7 @@ struct PreparedList {
Directory,
EmptyFile,
TooLargeFile,
PremiumRequired,
};
PreparedList() = default;
@@ -502,7 +502,7 @@ Storage::Cache::Key StorageFileLocation::bigFileBaseCacheKey() const {
| (_id >> 48);
const auto low = (_id << 16);
Ensures((low & 0xFFULL) == 0);
Ensures((low & 0x1FFULL) == 0);
return Storage::Cache::Key{ high, low };
}
@@ -310,7 +310,7 @@ ImageLocation FromWebDocument(const MTPWebDocument &document) {
// We don't use size from WebDocument, because it is not reliable.
// It can be > 0 and different from the real size
// that we get in upload.WebFile result.
//auto filesize = 0; // data.vsize().v;
//auto filesize = int64(); // data.vsize().v;
return ImageLocation(
DownloadLocation{ WebFileLocation(
data.vurl().v,
@@ -323,7 +323,7 @@ ImageLocation FromWebDocument(const MTPWebDocument &document) {
// We don't use size from WebDocument, because it is not reliable.
// It can be > 0 and different from the real size
// that we get in upload.WebFile result.
//auto filesize = 0; // data.vsize().v;
//auto filesize = int64(); // data.vsize().v;
return ImageLocation(
DownloadLocation{ PlainUrlLocation{ qs(data.vurl()) } },
size.width(),
+3 -3
View File
@@ -9,9 +9,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
namespace Ui {
inline constexpr auto FileStatusSizeReady = 0x7FFFFFF0;
inline constexpr auto FileStatusSizeLoaded = 0x7FFFFFF1;
inline constexpr auto FileStatusSizeFailed = 0x7FFFFFF2;
inline constexpr auto FileStatusSizeReady = 0xFFFFFFF0LL;
inline constexpr auto FileStatusSizeLoaded = 0xFFFFFFF1LL;
inline constexpr auto FileStatusSizeFailed = 0xFFFFFFF2LL;
[[nodiscard]] QString FormatSizeText(qint64 size);
[[nodiscard]] QString FormatDownloadText(qint64 ready, qint64 total);