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:
Joshua Goins
2025-09-09 11:43:25 +02:00
parent f53d47fa28
commit 5b4d3df6ee
5 changed files with 20 additions and 8 deletions

View File

@@ -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;
}