Remove Unread Count

Unread count is deprecated and notification count should be used in all cases. As such remove unreadCount and use notification count in all places it was being used.

Fixes network/neochat#76 \
BUG: 466515
This commit is contained in:
James Graham
2023-05-10 16:23:14 +00:00
parent 1db2e4a333
commit b362365609
3 changed files with 6 additions and 12 deletions

View File

@@ -161,7 +161,7 @@ void RoomListModel::connectRoomSignals(NeoChatRoom *room)
refresh(room, {DisplayNameRole, NameRole});
});
connect(room, &Room::unreadMessagesChanged, this, [this, room] {
refresh(room, {UnreadCountRole, NotificationCountRole, HighlightCountRole});
refresh(room, {NotificationCountRole, HighlightCountRole});
});
connect(room, &Room::notificationCountChanged, this, [this, room] {
refresh(room);
@@ -374,9 +374,6 @@ QVariant RoomListModel::data(const QModelIndex &index, int role) const
}
return NeoChatRoomType::Normal;
}
if (role == UnreadCountRole) {
return room->unreadCount();
}
if (role == NotificationCountRole) {
return room->notificationCount();
}
@@ -443,7 +440,6 @@ QHash<int, QByteArray> RoomListModel::roleNames() const
roles[CanonicalAliasRole] = "canonicalAlias";
roles[TopicRole] = "topic";
roles[CategoryRole] = "category";
roles[UnreadCountRole] = "unreadCount";
roles[NotificationCountRole] = "notificationCount";
roles[HighlightCountRole] = "highlightCount";
roles[LastEventRole] = "lastEvent";