Added support of unread poll votes to corner button from history widget.

This commit is contained in:
23rd
2026-03-24 12:37:53 +03:00
parent d1406f3f17
commit b01e0b77fe
32 changed files with 481 additions and 25 deletions
+24
View File
@@ -98,6 +98,22 @@ HistoryUnreadThings::ConstProxy Thread::unreadReactions() const {
};
}
HistoryUnreadThings::Proxy Thread::unreadPollVotes() {
return {
this,
_unreadThings,
HistoryUnreadThings::Type::PollVotes,
!!(_flags & Flag::UnreadThingsKnown),
};
}
HistoryUnreadThings::ConstProxy Thread::unreadPollVotes() const {
return {
_unreadThings ? &_unreadThings->pollVotes : nullptr,
!!(_flags & Flag::UnreadThingsKnown),
};
}
bool Thread::canToggleUnread(bool nowUnread) const {
if ((asTopic() || asForum()) && !nowUnread) {
return false;
@@ -125,6 +141,14 @@ const base::flat_set<MsgId> &Thread::unreadReactionsIds() const {
return _unreadThings->reactions.ids();
}
const base::flat_set<MsgId> &Thread::unreadPollVotesIds() const {
if (!_unreadThings) {
static const auto Result = base::flat_set<MsgId>();
return Result;
}
return _unreadThings->pollVotes.ids();
}
void Thread::clearNotifications() {
_notifications.clear();
}