aboutsummaryrefslogtreecommitdiff
path: root/lib/events
diff options
context:
space:
mode:
authorTobias Fella <fella@posteo.de>2022-04-08 23:23:30 +0200
committerTobias Fella <fella@posteo.de>2022-04-09 15:49:12 +0200
commitfc3ad90a054e3c674127a0cdd385ddbb98cf2010 (patch)
treefdce8a1816c9b7c5cd75fed366c582ab85e6b189 /lib/events
parent3c8e76869fd4f814a9e56a0e4e8f803b309aee61 (diff)
downloadlibquotient-fc3ad90a054e3c674127a0cdd385ddbb98cf2010.tar.gz
libquotient-fc3ad90a054e3c674127a0cdd385ddbb98cf2010.zip
Correctly load EncryptedEvents
Diffstat (limited to 'lib/events')
-rw-r--r--lib/events/roomevent.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/events/roomevent.h b/lib/events/roomevent.h
index c4b0131a..a7d6c428 100644
--- a/lib/events/roomevent.h
+++ b/lib/events/roomevent.h
@@ -80,6 +80,14 @@ using RoomEventPtr = event_ptr_tt<RoomEvent>;
using RoomEvents = EventsArray<RoomEvent>;
using RoomEventsRange = Range<RoomEvents>;
+template <>
+inline EventPtr doLoadEvent(const QJsonObject& json, const QString& matrixType)
+{
+ if (matrixType == "m.room.encrypted")
+ return RoomEvent::factory.loadEvent(json, matrixType);
+ return Event::factory.loadEvent(json, matrixType);
+}
+
class QUOTIENT_API CallEventBase : public RoomEvent {
public:
CallEventBase(Type type, event_mtype_t matrixType, const QString& callId,