diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-02-05 22:30:59 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-05 22:30:59 +0900 |
commit | 898f0c73b4d76c091e48c5e767b94d6ad18f582f (patch) | |
tree | 965074fffd32cae0dba11c494ae65b3c67bef28b /events | |
parent | 818fbda8c43fa76ede72db2e941ec81fe093cc59 (diff) | |
parent | f6b55a3c8fc60dd263954df3359027eff2ef1e18 (diff) | |
download | libquotient-898f0c73b4d76c091e48c5e767b94d6ad18f582f.tar.gz libquotient-898f0c73b4d76c091e48c5e767b94d6ad18f582f.zip |
Merge pull request #170 from QMatrixClient/kitsune-expose-download-urls
Expose download URLs
Diffstat (limited to 'events')
-rw-r--r-- | events/eventcontent.h | 4 | ||||
-rw-r--r-- | events/roommessageevent.cpp | 5 | ||||
-rw-r--r-- | events/roommessageevent.h | 1 |
3 files changed, 10 insertions, 0 deletions
diff --git a/events/eventcontent.h b/events/eventcontent.h index 4afbaff3..9d44aec0 100644 --- a/events/eventcontent.h +++ b/events/eventcontent.h @@ -200,6 +200,7 @@ namespace QMatrixClient explicit TypedBase(const QJsonObject& o = {}) : Base(o) { } virtual QMimeType type() const = 0; virtual const FileInfo* fileInfo() const { return nullptr; } + virtual const Thumbnail* thumbnailInfo() const { return nullptr; } }; /** @@ -256,6 +257,9 @@ namespace QMatrixClient "thumbnailMediaId", thumbnail.mediaId()); } + const Thumbnail* thumbnailInfo() const override + { return &thumbnail; } + public: Thumbnail thumbnail; diff --git a/events/roommessageevent.cpp b/events/roommessageevent.cpp index 8c088f21..dec0ca50 100644 --- a/events/roommessageevent.cpp +++ b/events/roommessageevent.cpp @@ -128,6 +128,11 @@ bool RoomMessageEvent::hasFileContent() const return content() && content()->fileInfo(); } +bool RoomMessageEvent::hasThumbnail() const +{ + return content() && content()->thumbnailInfo(); +} + QJsonObject RoomMessageEvent::toJson() const { QJsonObject obj = _content ? _content->toJson() : QJsonObject(); diff --git a/events/roommessageevent.h b/events/roommessageevent.h index 2a5eeb7e..a55564ed 100644 --- a/events/roommessageevent.h +++ b/events/roommessageevent.h @@ -61,6 +61,7 @@ namespace QMatrixClient QMimeType mimeType() const; bool hasTextContent() const; bool hasFileContent() const; + bool hasThumbnail() const; QJsonObject toJson() const; |