Texthandler edited

Move the handling of adding whether the message has been edited to texthandler.
This commit is contained in:
James Graham
2023-04-08 20:58:44 +00:00
parent e5f2e209a2
commit 4bf65339f8
7 changed files with 81 additions and 16 deletions

View File

@@ -57,7 +57,6 @@ QHash<int, QByteArray> MessageEventModel::roleNames() const
roles[ReadMarkersStringRole] = "readMarkersString";
roles[ShowReadMarkersRole] = "showReadMarkers";
roles[ReactionRole] = "reaction";
roles[IsEditedRole] = "isEdited";
roles[SourceRole] = "source";
roles[MimeTypeRole] = "mimeType";
roles[FormattedBodyRole] = "formattedBody";
@@ -662,14 +661,6 @@ QVariant MessageEventModel::data(const QModelIndex &idx, int role) const
return EventStatus::Normal;
}
if (role == IsEditedRole) {
if (auto e = eventCast<const RoomMessageEvent>(&evt)) {
return !e->unsignedJson().isEmpty() && e->unsignedJson().contains("m.relations")
&& e->unsignedJson()["m.relations"].toObject().contains("m.replace");
}
return false;
}
if (role == EventIdRole) {
return !evt.id().isEmpty() ? evt.id() : evt.transactionId();
}