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

Improve unread reactions list consistency.

This commit is contained in:
John Preston
2022-01-31 18:29:46 +03:00
parent 63bf564757
commit b7a70a2f28
9 changed files with 65 additions and 33 deletions

View File

@@ -679,14 +679,13 @@ bool MessageReactions::empty() const {
return _list.empty();
}
QString MessageReactions::findUnread() const {
bool MessageReactions::hasUnread() const {
for (auto &[emoji, list] : _recent) {
const auto i = ranges::find(list, true, &RecentReaction::unread);
if (i != end(list)) {
return emoji;
if (ranges::contains(list, true, &RecentReaction::unread)) {
return true;
}
}
return QString();
return false;
}
void MessageReactions::markRead() {

View File

@@ -163,7 +163,7 @@ public:
[[nodiscard]] QString chosen() const;
[[nodiscard]] bool empty() const;
[[nodiscard]] QString findUnread() const;
[[nodiscard]] bool hasUnread() const;
void markRead();
private: