Make rooms in the room list bold when there's unread messages
This used to be a feature but kinda broke/changed when we switched to focusing on context-aware or notable events. Basically instead of only notable events making a room bold in the room list, it's any unread messages now.
This commit is contained in:
@@ -119,7 +119,7 @@ void RoomListModel::connectRoomSignals(NeoChatRoom *room)
|
||||
refresh(room, {DisplayNameRole});
|
||||
});
|
||||
connect(room, &Room::unreadStatsChanged, this, [this, room] {
|
||||
refresh(room, {ContextNotificationCountRole, HasHighlightNotificationsRole});
|
||||
refresh(room, {ContextNotificationCountRole, HasHighlightNotificationsRole, NotificationCountRole});
|
||||
});
|
||||
connect(room, &Room::notificationCountChanged, this, [this, room] {
|
||||
refresh(room);
|
||||
@@ -271,6 +271,9 @@ QVariant RoomListModel::data(const QModelIndex &index, int role) const
|
||||
if (role == IsDirectChat) {
|
||||
return room->isDirectChat();
|
||||
}
|
||||
if (role == NotificationCountRole) {
|
||||
return room->notificationCount();
|
||||
}
|
||||
|
||||
return QVariant();
|
||||
}
|
||||
@@ -304,6 +307,7 @@ QHash<int, QByteArray> RoomListModel::roleNames() const
|
||||
roles[RoomIdRole] = "roomId";
|
||||
roles[IsChildSpaceRole] = "isChildSpace";
|
||||
roles[IsDirectChat] = "isDirectChat";
|
||||
roles[NotificationCountRole] = "notificationCount";
|
||||
return roles;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user