2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-30 22:16:14 +00:00

Use a special FileLoader for streamed documents.

This commit is contained in:
John Preston
2019-04-11 11:59:18 +04:00
parent 8c0cd9b9e9
commit ebf2a678b1
9 changed files with 345 additions and 219 deletions

View File

@@ -866,9 +866,10 @@ void DocumentData::save(
}
} else {
status = FileReady;
/* if (auto reader = owner().documentStreamedReader(this, origin)) {
if (auto reader = owner().documentStreamedReader(this, origin)) {
_loader = new Storage::StreamedFileDownloader(
id,
_dc,
origin,
(saveToCache()
? std::make_optional(Data::DocumentCacheKey(_dc, id))
@@ -881,7 +882,7 @@ void DocumentData::save(
fromCloud,
autoLoading,
cacheTag());
} else */if (hasWebLocation()) {
} else if (hasWebLocation()) {
_loader = new mtpFileLoader(
_urlLocation,
size,