aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorHubert Chathi <uhoreg@debian.org>2019-01-14 11:21:45 -0500
committerHubert Chathi <uhoreg@debian.org>2019-01-14 11:21:45 -0500
commitd488348d41b1abecd858a2625099dc94a8b05eac (patch)
tree8736c10809e5fac1dd7527e2562e948f09d109ae /lib
parent34da172eadf142cb13825086ab10e5627fff2668 (diff)
parent863848b2158e3278ae65d25de0b189a6008c60d1 (diff)
downloadlibquotient-d488348d41b1abecd858a2625099dc94a8b05eac.tar.gz
libquotient-d488348d41b1abecd858a2625099dc94a8b05eac.zip
Merge branch 'upstream' (v0.4.2.1)
Diffstat (limited to 'lib')
-rw-r--r--lib/events/stateevent.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/events/stateevent.cpp b/lib/events/stateevent.cpp
index fd5d2642..877d0fae 100644
--- a/lib/events/stateevent.cpp
+++ b/lib/events/stateevent.cpp
@@ -21,7 +21,17 @@
using namespace QMatrixClient;
[[gnu::unused]] static auto stateEventTypeInitialised =
- RoomEvent::factory_t::chainFactory<StateEventBase>();
+ RoomEvent::factory_t::addMethod(
+ [] (const QJsonObject& json, const QString& matrixType) -> StateEventPtr
+ {
+ if (!json.contains("state_key"))
+ return nullptr;
+
+ if (auto e = StateEventBase::factory_t::make(json, matrixType))
+ return e;
+
+ return nullptr;
+ });
bool StateEventBase::repeatsState() const
{