summary refs log tree commit diff
path: root/src/RoomInfoListItem.cpp
diff options
context:
space:
mode:
authorEmi Simpson <emi@alchemi.dev>2020-03-15 16:28:32 -0400
committerEmi Simpson <emi@alchemi.dev>2020-03-15 16:28:32 -0400
commitd51cbe7e32f4ad332baa2a0172867d051ec1a901 (patch)
tree33ba9632cf526288835aad8d1592b7a548cdc365 /src/RoomInfoListItem.cpp
parentClean up stray comment (diff)
downloadnheko-d51cbe7e32f4ad332baa2a0172867d051ec1a901.tar.xz
Place invites on top of room list even when sorting by importance is off
Diffstat (limited to 'src/RoomInfoListItem.cpp')
-rw-r--r--src/RoomInfoListItem.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/RoomInfoListItem.cpp b/src/RoomInfoListItem.cpp
index eaec34fc..fa63a36b 100644
--- a/src/RoomInfoListItem.cpp
+++ b/src/RoomInfoListItem.cpp
@@ -333,10 +333,9 @@ enum NotificationImportance : short
 {
         ImportanceDisabled = -1,
         AllEventsRead      = 0,
-        NewMinorEvents     = 1, // This is currently unused
-        NewMessage         = 2,
-        NewMentions        = 3,
-        Invite             = 4
+        NewMessage         = 1,
+        NewMentions        = 2,
+        Invite             = 3
 };
 
 unsigned short int
@@ -344,11 +343,11 @@ RoomInfoListItem::calculateImportance() const
 {
         // Returns the degree of importance of the unread messages in the room.
         // If sorting by importance is disabled in settings, this only ever
-        // returns ImportanceDisabled
-        if (!settings->isSortByImportanceEnabled()) {
-                return ImportanceDisabled;
-        } else if (isInvite()) {
+        // returns ImportanceDisabled or Invite
+        if (isInvite()) {
                 return Invite;
+        } else if (!settings->isSortByImportanceEnabled()) {
+                return ImportanceDisabled;
         } else if (unreadHighlightedMsgCount_) {
                 return NewMentions;
         } else if (unreadMsgCount_) {