mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-26 04:58:49 +03:00
Switched room importance to an enum
This commit is contained in:
parent
a5b388db15
commit
81c9cb5c79
1 changed files with 20 additions and 2 deletions
|
@ -324,6 +324,15 @@ RoomInfoListItem::updateUnreadMessageCount(int count, int highlightedCount)
|
|||
update();
|
||||
}
|
||||
|
||||
enum NotificationImportance : unsigned short
|
||||
{
|
||||
AllEventsRead = 0,
|
||||
NewMinorEvents = 1,
|
||||
NewMessage = 2,
|
||||
NewMentions = 3,
|
||||
Invite = 4
|
||||
};
|
||||
|
||||
unsigned short int
|
||||
RoomInfoListItem::calculateImportance() const
|
||||
{
|
||||
|
@ -332,8 +341,17 @@ RoomInfoListItem::calculateImportance() const
|
|||
// 2: Contains unread messages
|
||||
// 3: Contains mentions
|
||||
// 4: Is a room invite
|
||||
return (hasUnreadMessages_) + (unreadHighlightedMsgCount_ + unreadMsgCount_ != 0) +
|
||||
(unreadHighlightedMsgCount_ != 0) + (isInvite()) * 4;
|
||||
if (isInvite()) {
|
||||
return Invite;
|
||||
} else if (unreadHighlightedMsgCount_) {
|
||||
return NewMentions;
|
||||
} else if (unreadMsgCount_) {
|
||||
return NewMessage;
|
||||
} else if (hasUnreadMessages_) {
|
||||
return NewMinorEvents;
|
||||
} else {
|
||||
return AllEventsRead;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
|
Loading…
Reference in a new issue