Move showAuthor role to MessageModel, so it's available for all models

This fixes features like the search model, where no message delegates
could be created because it's missing showAuthor.
This commit is contained in:
Joshua Goins
2025-01-11 18:05:21 -05:00
committed by James Graham
parent a67ce75924
commit 1d532a1fc1
4 changed files with 7 additions and 3 deletions

View File

@@ -300,6 +300,10 @@ QVariant MessageModel::data(const QModelIndex &idx, int role) const
&& event.value().get().senderId() == m_room->localMember().id();
}
if (role == ShowAuthorRole) {
return true;
}
return {};
}
@@ -329,6 +333,7 @@ QHash<int, QByteArray> MessageModel::roleNames() const
roles[ContentModelRole] = "contentModel";
roles[MediaInfoRole] = "mediaInfo";
roles[IsEditableRole] = "isEditable";
roles[ShowAuthorRole] = "showAuthor";
return roles;
}