libQuotient
A Qt library for building matrix clients
roomavatarevent.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: 2017 Kitsune Ral <kitsune-ral@users.sf.net>
2 // SPDX-License-Identifier: LGPL-2.1-or-later
3 
4 #pragma once
5 
6 #include "eventcontent.h"
7 #include "stateevent.h"
8 
9 namespace Quotient {
10 class QUOTIENT_API RoomAvatarEvent
11  : public KeylessStateEventBase<RoomAvatarEvent,
12  EventContent::ImageContent> {
13  // It's a bit of an overkill to use a full-fledged ImageContent
14  // because in reality m.room.avatar usually only has a single URL,
15  // without a thumbnail. But The Spec says there be thumbnails, and
16  // we follow The Spec (and ImageContent is very convenient to reuse here).
17 public:
18  QUO_EVENT(RoomAvatarEvent, "m.room.avatar")
19  using KeylessStateEventBase::KeylessStateEventBase;
20 
21  QUrl url() const { return content().url(); }
22 };
23 } // namespace Quotient