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

Use StorageFileLocation in mtpFileLoader.

This commit is contained in:
John Preston
2019-03-25 15:50:42 +04:00
parent 95023ca770
commit 8759d637ff
13 changed files with 167 additions and 230 deletions

View File

@@ -851,7 +851,7 @@ void DocumentData::save(
status = FileReady;
if (hasWebLocation()) {
_loader = new mtpFileLoader(
&_urlLocation,
_urlLocation,
size,
fromCloud,
autoLoading,
@@ -865,10 +865,14 @@ void DocumentData::save(
cacheTag());
} else {
_loader = new mtpFileLoader(
_dc,
id,
_access,
_fileReference,
StorageFileLocation(
_dc,
session().userId(),
MTP_inputDocumentFileLocation(
MTP_long(id),
MTP_long(_access),
MTP_bytes(_fileReference),
MTP_string(QString()))),
origin,
locationType(),
toFile,
@@ -1209,7 +1213,7 @@ auto DocumentData::createStreamingLoader(Data::FileOrigin origin) const
}
bool DocumentData::hasWebLocation() const {
return _urlLocation.dc() != 0 && _urlLocation.accessHash() != 0;
return !_urlLocation.url().isEmpty();
}
bool DocumentData::isNull() const {