Implement sharing with Purpose (export)

This provide both a mobile and desktop view

Fix #181
This commit is contained in:
Carl Schwan
2022-02-05 16:30:02 +00:00
parent 3e6f38c8ea
commit ca8a21c0eb
14 changed files with 531 additions and 63 deletions

View File

@@ -47,6 +47,7 @@ QHash<int, QByteArray> MessageEventModel::roleNames() const
roles[ReactionRole] = "reaction";
roles[IsEditedRole] = "isEdited";
roles[SourceRole] = "source";
roles[MimeTypeRole] = "mimeType";
roles[FormattedBodyRole] = "formattedBody";
return roles;
}
@@ -544,6 +545,15 @@ QVariant MessageEventModel::data(const QModelIndex &idx, int role) const
return e->content()->fileInfo()->mimeType.iconName();
}
if (role == MimeTypeRole) {
auto e = eventCast<const RoomMessageEvent>(&evt);
if (!e || !e->hasFileContent()) {
return QVariant();
}
return e->content()->fileInfo()->mimeType.name();
}
if (role == SpecialMarksRole) {
if (isPending) {
return pendingIt->deliveryStatus();