From 7c10807549b2a73527bd594789d0e5b9ab58c874 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Sun, 25 Feb 2018 17:24:59 +0900 Subject: TagEvent: m.tag events parsing Using them in rooms and connection comes in the next commit. --- events/event.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'events/event.cpp') diff --git a/events/event.cpp b/events/event.cpp index 366aa858..b55c44c4 100644 --- a/events/event.cpp +++ b/events/event.cpp @@ -24,6 +24,7 @@ #include "roomavatarevent.h" #include "typingevent.h" #include "receiptevent.h" +#include "tagevent.h" #include "redactionevent.h" #include "logging.h" @@ -44,6 +45,11 @@ Event::Event(Type type, const QJsonObject& rep) Event::~Event() = default; +QString Event::jsonType() const +{ + return originalJsonObject().value("type").toString(); +} + QByteArray Event::originalJson() const { return QJsonDocument(_originalJson).toJson(); @@ -82,7 +88,7 @@ EventPtr _impl::doMakeEvent(const QJsonObject& obj) return EventPtr(move(e)); return EventPtr { makeIfMatches(obj, obj["type"].toString()) }; + TypingEvent, ReceiptEvent, TagEvent>(obj, obj["type"].toString()) }; } RoomEvent::RoomEvent(Event::Type type) : Event(type) { } -- cgit v1.2.3