Hide rooms with custom defined types in quick switcher

This matches the behavior in other room lists. I also tried to normalize
the constructor with SortFilterRoomTreeModel.

(cherry picked from commit 847db41fb3)
This commit is contained in:
Joshua Goins
2026-02-10 20:11:48 -05:00
parent d8984dc812
commit 9cadce88bb
3 changed files with 15 additions and 4 deletions

View File

@@ -276,6 +276,11 @@ QVariant RoomListModel::data(const QModelIndex &index, int role) const
if (role == NotificationCountRole) {
return room->notificationCount();
}
if (role == RoomTypeRole) {
if (room->creation()) {
return room->creation()->contentPart<QString>("type"_L1);
}
}
return QVariant();
}
@@ -310,6 +315,7 @@ QHash<int, QByteArray> RoomListModel::roleNames() const
roles[IsChildSpaceRole] = "isChildSpace";
roles[IsDirectChat] = "isDirectChat";
roles[NotificationCountRole] = "notificationCount";
roles[RoomTypeRole] = "roomType";
return roles;
}

View File

@@ -54,6 +54,7 @@ public:
ReplacementIdRole, /**< The room id of the room replacing this one, if any. */
IsDirectChat, /**< Whether this room is a direct chat. */
NotificationCountRole, /**< Count of all notifications that also include non-notable events like unread messages. */
RoomTypeRole, /**< The room's type. */
};
Q_ENUM(EventRoles)