Appease the linter
This commit is contained in:
parent
389117f1e8
commit
a5b388db15
@ -332,10 +332,8 @@ RoomInfoListItem::calculateImportance() const
|
|||||||
// 2: Contains unread messages
|
// 2: Contains unread messages
|
||||||
// 3: Contains mentions
|
// 3: Contains mentions
|
||||||
// 4: Is a room invite
|
// 4: Is a room invite
|
||||||
return (hasUnreadMessages_) +
|
return (hasUnreadMessages_) + (unreadHighlightedMsgCount_ + unreadMsgCount_ != 0) +
|
||||||
(unreadHighlightedMsgCount_ + unreadMsgCount_ != 0) +
|
(unreadHighlightedMsgCount_ != 0) + (isInvite()) * 4;
|
||||||
(unreadHighlightedMsgCount_ != 0) +
|
|
||||||
(isInvite()) * 4;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -331,8 +331,10 @@ RoomList::updateRoomDescription(const QString &roomid, const DescInfo &info)
|
|||||||
emit sortRoomsByLastMessage();
|
emit sortRoomsByLastMessage();
|
||||||
}
|
}
|
||||||
|
|
||||||
struct room_sort {
|
struct room_sort
|
||||||
bool operator() (const RoomInfoListItem * a, const RoomInfoListItem * b) const {
|
{
|
||||||
|
bool operator()(const RoomInfoListItem *a, const RoomInfoListItem *b) const
|
||||||
|
{
|
||||||
// Sort by "importance" (i.e. invites before mentions before
|
// Sort by "importance" (i.e. invites before mentions before
|
||||||
// notifs before new events before old events), then secondly
|
// notifs before new events before old events), then secondly
|
||||||
// by recency.
|
// by recency.
|
||||||
@ -346,10 +348,12 @@ struct room_sort {
|
|||||||
|
|
||||||
// Now sort by recency
|
// Now sort by recency
|
||||||
// Zero if empty, otherwise the time that the event occured
|
// Zero if empty, otherwise the time that the event occured
|
||||||
const uint64_t a_recency = a->lastMessageInfo().userid.isEmpty() ? 0 :
|
const uint64_t a_recency = a->lastMessageInfo().userid.isEmpty()
|
||||||
a->lastMessageInfo().datetime.toMSecsSinceEpoch();
|
? 0
|
||||||
const uint64_t b_recency = b->lastMessageInfo().userid.isEmpty() ? 0 :
|
: a->lastMessageInfo().datetime.toMSecsSinceEpoch();
|
||||||
b->lastMessageInfo().datetime.toMSecsSinceEpoch();
|
const uint64_t b_recency = b->lastMessageInfo().userid.isEmpty()
|
||||||
|
? 0
|
||||||
|
: b->lastMessageInfo().datetime.toMSecsSinceEpoch();
|
||||||
return a_recency > b_recency;
|
return a_recency > b_recency;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user