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

Receive and track recent sticker usage date.

This commit is contained in:
John Preston
2018-03-07 20:43:26 +03:00
parent f0a95032a5
commit ccef155f7a
6 changed files with 70 additions and 11 deletions

View File

@@ -4060,9 +4060,16 @@ void MainWidget::incrementSticker(DocumentData *sticker) {
}
auto index = it->stickers.indexOf(sticker);
if (index > 0) {
if (!it->dates.empty()) {
Assert(it->dates.size() == it->stickers.size());
it->dates.erase(it->dates.begin() + index);
}
it->stickers.removeAt(index);
}
if (index) {
if (it->dates.size() == it->stickers.size()) {
it->dates.insert(it->dates.begin(), unixtime());
}
it->stickers.push_front(sticker);
writeRecentStickers = true;
}