aboutsummaryrefslogtreecommitdiff
path: root/lib/events/roomavatarevent.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/events/roomavatarevent.h')
-rw-r--r--lib/events/roomavatarevent.h19
1 files changed, 4 insertions, 15 deletions
diff --git a/lib/events/roomavatarevent.h b/lib/events/roomavatarevent.h
index 2ebe29bf..1986f852 100644
--- a/lib/events/roomavatarevent.h
+++ b/lib/events/roomavatarevent.h
@@ -8,26 +8,15 @@
namespace Quotient {
class QUOTIENT_API RoomAvatarEvent
- : public StateEvent<EventContent::ImageContent> {
+ : public KeylessStateEventBase<RoomAvatarEvent,
+ EventContent::ImageContent> {
// It's a bit of an overkill to use a full-fledged ImageContent
// because in reality m.room.avatar usually only has a single URL,
// without a thumbnail. But The Spec says there be thumbnails, and
- // we follow The Spec.
+ // we follow The Spec (and ImageContent is very convenient to reuse here).
public:
QUO_EVENT(RoomAvatarEvent, "m.room.avatar")
- explicit RoomAvatarEvent(const QJsonObject& obj) : StateEvent(typeId(), obj)
- {}
- explicit RoomAvatarEvent(const EventContent::ImageContent& avatar)
- : StateEvent(typeId(), matrixTypeId(), QString(), avatar)
- {}
- // A replica of EventContent::ImageInfo constructor
- explicit RoomAvatarEvent(const QUrl& mxcUrl, qint64 fileSize = -1,
- QMimeType mimeType = {},
- const QSize& imageSize = {},
- const QString& originalFilename = {})
- : RoomAvatarEvent(EventContent::ImageContent {
- mxcUrl, fileSize, mimeType, imageSize, originalFilename })
- {}
+ using KeylessStateEventBase::KeylessStateEventBase;
QUrl url() const { return content().url(); }
};