Space overview: Fix displayed name of direct chats

When in the space overview page, direct chats were previously only
shown with their room ID. Fix this by getting the actual NeoChatRoom
and its displayName.
This commit is contained in:
Arno Rehn
2025-10-05 16:40:59 +02:00
committed by Tobias Fella
parent 2b0251c593
commit 5c49c35b82

View File

@@ -173,6 +173,10 @@ QVariant SpaceChildrenModel::data(const QModelIndex &index, int role) const
SpaceTreeItem *child = getItem(index);
if (role == DisplayNameRole) {
if (const auto room = static_cast<NeoChatRoom *>(m_space->connection()->room(child->id()))) {
return room->displayName();
}
auto displayName = child->name();
if (!displayName.isEmpty()) {
return displayName;