aboutsummaryrefslogtreecommitdiff
path: root/events/event.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'events/event.cpp')
-rw-r--r--events/event.cpp8
1 files changed, 7 insertions, 1 deletions
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<Event>(const QJsonObject& obj)
return EventPtr(move(e));
return EventPtr { makeIfMatches<Event,
- TypingEvent, ReceiptEvent>(obj, obj["type"].toString()) };
+ TypingEvent, ReceiptEvent, TagEvent>(obj, obj["type"].toString()) };
}
RoomEvent::RoomEvent(Event::Type type) : Event(type) { }