diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-01-16 17:00:16 +0900 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-01-16 17:00:16 +0900 |
commit | 038659c6997e5acad6ecf7171bbd3c4ec14b5d3d (patch) | |
tree | fcd84dea699bc019a11d498c9f44c8a447aed653 | |
parent | 5d6360b641084cf95a7f30bb760abdb7a73ebd27 (diff) | |
download | libquotient-038659c6997e5acad6ecf7171bbd3c4ec14b5d3d.tar.gz libquotient-038659c6997e5acad6ecf7171bbd3c4ec14b5d3d.zip |
EventContent: inject mediaThumbnailId into content original JSON
For QML to easily make URLs to thumbnails.
-rw-r--r-- | events/eventcontent.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/events/eventcontent.h b/events/eventcontent.h index 0733b347..4afbaff3 100644 --- a/events/eventcontent.h +++ b/events/eventcontent.h @@ -247,10 +247,14 @@ namespace QMatrixClient { public: // TODO: POD constructor - UrlWithThumbnailContent(const QJsonObject& json) + explicit UrlWithThumbnailContent(const QJsonObject& json) : UrlBasedContent<InfoT>(json) , thumbnail(InfoT::originalInfoJson) - { } + { + // Another small hack, to simplify making a thumbnail link + UrlBasedContent<InfoT>::originalJson.insert( + "thumbnailMediaId", thumbnail.mediaId()); + } public: Thumbnail thumbnail; |