aboutsummaryrefslogtreecommitdiff
path: root/lib/events/event.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/events/event.h')
-rw-r--r--lib/events/event.h16
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/events/event.h b/lib/events/event.h
index d614115a..68e598ad 100644
--- a/lib/events/event.h
+++ b/lib/events/event.h
@@ -18,15 +18,9 @@
#pragma once
-#include <QtCore/QString>
-#include <QtCore/QDateTime>
-#include <QtCore/QJsonObject>
-#include <QtCore/QJsonArray>
-
+#include "converters.h"
#include "util.h"
-#include <memory>
-
namespace QMatrixClient
{
template <typename EventT>
@@ -110,6 +104,14 @@ namespace QMatrixClient
EventPtr doMakeEvent<Event>(const QJsonObject& obj);
}
+ template <> struct FromJson<EventPtr>
+ {
+ EventPtr operator()(const QJsonValue& jv) const
+ {
+ return makeEvent<Event>(jv.toObject());
+ }
+ };
+
/**
* \brief A vector of pointers to events with deserialisation capabilities
*