Fix notification count refresh for low-priority and mentions-only rooms

(cherry picked from commit 5f7967363f)
This commit is contained in:
Azhar Momin
2026-01-03 14:49:43 +05:30
committed by Joshua Goins
parent b3aa2abd89
commit e156d4da90
4 changed files with 30 additions and 20 deletions

View File

@@ -170,10 +170,12 @@ void RoomTreeModel::connectRoomSignals(NeoChatRoom *room)
connect(room, &Room::displaynameChanged, this, [this, room] {
refreshRoomRoles(room, {DisplayNameRole});
});
connect(room, &Room::unreadStatsChanged, this, [this, room] {
refreshRoomRoles(room, {ContextNotificationCountRole, HasHighlightNotificationsRole, NotificationCountRole});
if (room->isServerNoticeRoom()) {
Q_EMIT invalidateSort();
connect(room, &Room::changed, this, [this, room](Room::Changes changes) {
if (changes & (Room::Change::UnreadStats | Room::Change::Highlights)) {
refreshRoomRoles(room, {ContextNotificationCountRole, HasHighlightNotificationsRole, NotificationCountRole});
if (room->isServerNoticeRoom()) {
Q_EMIT invalidateSort();
}
}
});
connect(room, &Room::avatarChanged, this, [this, room] {