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

Fix file references for faved stickers.

This commit is contained in:
John Preston
2018-08-28 14:32:27 +03:00
parent 018abd6aad
commit 51092fb6a9
5 changed files with 33 additions and 11 deletions

View File

@@ -176,9 +176,17 @@ void UndoInstallLocally(uint64 setId) {
LayerOption::KeepOther);
}
bool IsFaved(not_null<DocumentData*> document) {
auto it = Auth().data().stickerSets().constFind(FavedSetId);
return (it != Auth().data().stickerSets().cend()) && it->stickers.contains(document);
bool IsFaved(not_null<const DocumentData*> document) {
const auto it = Auth().data().stickerSets().constFind(FavedSetId);
if (it == Auth().data().stickerSets().cend()) {
return false;
}
for (const auto sticker : it->stickers) {
if (sticker == document) {
return true;
}
}
return false;
}
void CheckFavedLimit(Set &set) {