Use a reasonable role for message source

This commit is contained in:
Tobias Fella
2021-12-15 01:03:05 +01:00
parent 332d6c9782
commit 0c5932b3da
3 changed files with 5 additions and 3 deletions

View File

@@ -46,6 +46,7 @@ QHash<int, QByteArray> MessageEventModel::roleNames() const
roles[ShowSectionRole] = "showSection";
roles[ReactionRole] = "reaction";
roles[IsEditedRole] = "isEdited";
roles[SourceRole] = "source";
roles[FormattedBodyRole] = "formattedBody";
return roles;
}
@@ -456,7 +457,7 @@ QVariant MessageEventModel::data(const QModelIndex &idx, int role) const
return m_currentRoom->eventToString(evt);
}
if (role == Qt::ToolTipRole) {
if (role == SourceRole) {
return evt.originalJson();
}