mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-07-25 15:04:57 +00:00
Added support of unread poll votes to corner button from history widget.
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user