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:
@@ -171,7 +171,7 @@ void RoomTreeModel::connectRoomSignals(NeoChatRoom *room)
|
||||
refreshRoomRoles(room, {DisplayNameRole});
|
||||
});
|
||||
connect(room, &Room::unreadStatsChanged, this, [this, room] {
|
||||
refreshRoomRoles(room, {ContextNotificationCountRole, HasHighlightNotificationsRole});
|
||||
refreshRoomRoles(room, {ContextNotificationCountRole, HasHighlightNotificationsRole, NotificationCountRole});
|
||||
if (room->isServerNoticeRoom()) {
|
||||
Q_EMIT invalidateSort();
|
||||
}
|
||||
@@ -294,6 +294,7 @@ QHash<int, QByteArray> RoomTreeModel::roleNames() const
|
||||
roles[DelegateTypeRole] = "delegateType";
|
||||
roles[IconRole] = "icon";
|
||||
roles[RoomTypeRole] = "roomType";
|
||||
roles[NotificationCountRole] = "notificationCount";
|
||||
return roles;
|
||||
}
|
||||
|
||||
@@ -396,6 +397,9 @@ QVariant RoomTreeModel::data(const QModelIndex &index, int role) const
|
||||
return room->creation()->contentPart<QString>("type"_L1);
|
||||
}
|
||||
}
|
||||
if (role == NotificationCountRole) {
|
||||
return room->notificationCount();
|
||||
}
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user