aboutsummaryrefslogtreecommitdiff
path: root/lib/events/eventloader.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/events/eventloader.h')
-rw-r--r--lib/events/eventloader.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/events/eventloader.h b/lib/events/eventloader.h
index cd2f9149..da663392 100644
--- a/lib/events/eventloader.h
+++ b/lib/events/eventloader.h
@@ -57,11 +57,15 @@ namespace QMatrixClient {
matrixType);
}
- template <typename EventT> struct FromJsonObject<event_ptr_tt<EventT>>
+ template <typename EventT> struct JsonConverter<event_ptr_tt<EventT>>
{
- auto operator()(const QJsonObject& jo) const
+ static auto load(const QJsonValue& jv)
{
- return loadEvent<EventT>(jo);
+ return loadEvent<EventT>(jv.toObject());
+ }
+ static auto load(const QJsonDocument& jd)
+ {
+ return loadEvent<EventT>(jd.object());
}
};
} // namespace QMatrixClient