2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-30 22:25:12 +00:00

Index new unread reactions in history.

This commit is contained in:
John Preston
2022-01-27 17:38:59 +03:00
parent 8f33d5903d
commit 9903266722
5 changed files with 59 additions and 26 deletions

View File

@@ -595,6 +595,24 @@ bool MessageReactions::empty() const {
return _list.empty();
}
QString MessageReactions::findUnread() const {
for (auto &[emoji, list] : _recent) {
const auto i = ranges::find(list, true, &RecentReaction::unread);
if (i != end(list)) {
return emoji;
}
}
return QString();
}
void MessageReactions::markRead() {
for (auto &[emoji, list] : _recent) {
for (auto &reaction : list) {
reaction.unread = false;
}
}
}
QString MessageReactions::chosen() const {
return _chosen;
}