2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Save secure files to local storage.

This commit is contained in:
John Preston
2018-03-29 01:01:28 +04:00
parent c2aa9c571c
commit 2bc60fa54f
2 changed files with 29 additions and 6 deletions

View File

@@ -773,6 +773,12 @@ bool mtpFileLoader::feedPart(int offset, bytes::const_span buffer) {
Local::writeStickerImage(mkey, _data);
} else if (_locationType == AudioFileLocation) {
Local::writeAudio(mkey, _data);
} else if (_locationType == SecureFileLocation) {
Local::writeImage(
StorageKey(
storageMix32To64(_locationType, _dcId),
_id),
StorageImageSaved(_data));
}
}
} else {
@@ -896,6 +902,10 @@ bool mtpFileLoader::tryLoadLocal() {
_localTaskId = Local::startStickerImageLoad(mkey, this);
} else if (_locationType == AudioFileLocation) {
_localTaskId = Local::startAudioLoad(mkey, this);
} else if (_locationType == SecureFileLocation) {
_localTaskId = Local::startImageLoad(StorageKey(
storageMix32To64(_locationType, _dcId),
_id), this);
}
}
}