aboutsummaryrefslogtreecommitdiff
path: root/events
diff options
context:
space:
mode:
Diffstat (limited to 'events')
-rw-r--r--events/eventcontent.cpp1
-rw-r--r--events/eventcontent.h5
2 files changed, 4 insertions, 2 deletions
diff --git a/events/eventcontent.cpp b/events/eventcontent.cpp
index c96da9b3..f5974b46 100644
--- a/events/eventcontent.cpp
+++ b/events/eventcontent.cpp
@@ -44,7 +44,6 @@ FileInfo::FileInfo(const QUrl& u, const QJsonObject& infoJson,
, payloadSize(infoJson["size"].toInt())
, originalName(originalFilename)
{
- originalInfoJson.insert("mediaId", url.authority() + url.path());
if (!mimeType.isValid())
mimeType = QMimeDatabase().mimeTypeForData(QByteArray());
}
diff --git a/events/eventcontent.h b/events/eventcontent.h
index 91e4ca94..0733b347 100644
--- a/events/eventcontent.h
+++ b/events/eventcontent.h
@@ -223,7 +223,10 @@ namespace QMatrixClient
: TypedBase(json)
, InfoT(json["url"].toString(), json["info"].toObject(),
json["filename"].toString())
- { }
+ {
+ // A small hack to facilitate links creation in QML.
+ originalJson.insert("mediaId", InfoT::mediaId());
+ }
QMimeType type() const override { return InfoT::mimeType; }
const FileInfo* fileInfo() const override { return this; }