2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 14:45:14 +00:00

Fix working with document thumbnails.

This commit is contained in:
John Preston
2019-04-04 00:05:29 +04:00
parent 7f598e358a
commit 456a949d01
4 changed files with 29 additions and 17 deletions

View File

@@ -4009,6 +4009,11 @@ void readSavedGifs() {
}
auto &saved = Auth().data().savedGifsRef();
const auto failed = [&] {
clearKey(_savedGifsKey);
_savedGifsKey = 0;
saved.clear();
};
saved.clear();
quint32 cnt;
@@ -4017,7 +4022,11 @@ void readSavedGifs() {
OrderedSet<DocumentId> read;
for (uint32 i = 0; i < cnt; ++i) {
auto document = Serialize::Document::readFromStream(gifs.version, gifs.stream);
if (!document || !document->isGifv()) continue;
if (!_checkStreamStatus(gifs.stream)) {
return failed();
} else if (!document || !document->isGifv()) {
continue;
}
if (read.contains(document->id)) continue;
read.insert(document->id);