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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user