diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2017-05-22 10:22:28 +0900 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2017-05-22 10:22:28 +0900 |
commit | be838b2f4f294a7e1b3f8a771f91d9d1eac14431 (patch) | |
tree | f720ae5a5a52bdd48fdaec17dea3c1c32fe10cd9 /events/roomcanonicalaliasevent.h | |
parent | 34764f3020c360ebc769cfe154e79b9e7e98f0f7 (diff) | |
download | libquotient-be838b2f4f294a7e1b3f8a771f91d9d1eac14431.tar.gz libquotient-be838b2f4f294a7e1b3f8a771f91d9d1eac14431.zip |
Refactored Events
The biggest change is we have no pimpls in Event objects anymore - because it's two new's instead of one per Event, and we have thousands and even more of Events created during initial sync. The other big change is introduction of RoomEvent, so that now the structure of events almost precisely reflects the CS API spec. The refactoring made UnknownEvent unnecessary as a separate class; a respective base class (either RoomEvent or Event) is used for this purpose now. All the other changes are consequences of these (mostly of RoomEvent introduction).
Diffstat (limited to 'events/roomcanonicalaliasevent.h')
-rw-r--r-- | events/roomcanonicalaliasevent.h | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/events/roomcanonicalaliasevent.h b/events/roomcanonicalaliasevent.h index 87219be6..72620d74 100644 --- a/events/roomcanonicalaliasevent.h +++ b/events/roomcanonicalaliasevent.h @@ -22,18 +22,17 @@ namespace QMatrixClient { - class RoomCanonicalAliasEvent: public Event + class RoomCanonicalAliasEvent : public RoomEvent { public: - RoomCanonicalAliasEvent(); - virtual ~RoomCanonicalAliasEvent(); + explicit RoomCanonicalAliasEvent(const QJsonObject& obj) + : RoomEvent(Type::RoomCanonicalAlias, obj) + , _canonicalAlias(contentJson()["alias"].toString()) + { } - QString alias(); - - static RoomCanonicalAliasEvent* fromJson(const QJsonObject& obj); + QString alias() const { return _canonicalAlias; } private: - class Private; - Private* d; + QString _canonicalAlias; }; -} +} // namespace QMatrixClient |