aboutsummaryrefslogtreecommitdiff
path: root/lib/events
diff options
context:
space:
mode:
authorTobias Fella <fella@posteo.de>2022-09-24 14:27:16 +0200
committerTobias Fella <fella@posteo.de>2022-09-24 14:27:16 +0200
commit4146f33bda60d04db34fbd5614439b22b5d5837f (patch)
treeab033fd10bbcb23798aa21d38bf164992944cd36 /lib/events
parentf161519740da12c2578d6ecf79a501e10c2debae (diff)
downloadlibquotient-4146f33bda60d04db34fbd5614439b22b5d5837f.tar.gz
libquotient-4146f33bda60d04db34fbd5614439b22b5d5837f.zip
Use basicJson()
Diffstat (limited to 'lib/events')
-rw-r--r--lib/events/encryptedevent.cpp26
1 files changed, 8 insertions, 18 deletions
diff --git a/lib/events/encryptedevent.cpp b/lib/events/encryptedevent.cpp
index 9ef3b22a..49df25c8 100644
--- a/lib/events/encryptedevent.cpp
+++ b/lib/events/encryptedevent.cpp
@@ -8,29 +8,19 @@ using namespace Quotient;
EncryptedEvent::EncryptedEvent(const QJsonObject& ciphertexts,
const QString& senderKey)
- : RoomEvent({
- {"content", QJsonObject{
- { AlgorithmKeyL, OlmV1Curve25519AesSha2AlgoKey },
- { CiphertextKeyL, ciphertexts },
- { SenderKeyKeyL, senderKey }
- }},
- {TypeKeyL, "m.room.encrypted"}
- })
+ : RoomEvent(basicJson(TypeId, { { AlgorithmKeyL, OlmV1Curve25519AesSha2AlgoKey },
+ { CiphertextKeyL, ciphertexts },
+ { SenderKeyKeyL, senderKey } }))
{}
EncryptedEvent::EncryptedEvent(const QByteArray& ciphertext,
const QString& senderKey,
const QString& deviceId, const QString& sessionId)
- : RoomEvent({
- {"content", QJsonObject{
- { AlgorithmKeyL, MegolmV1AesSha2AlgoKey },
- { CiphertextKeyL, QString(ciphertext) },
- { DeviceIdKeyL, deviceId },
- { SenderKeyKeyL, senderKey },
- { SessionIdKeyL, sessionId },
- }},
- {TypeKeyL, "m.room.encrypted"}
- })
+ : RoomEvent(basicJson(TypeId, { { AlgorithmKeyL, MegolmV1AesSha2AlgoKey },
+ { CiphertextKeyL, QString(ciphertext) },
+ { DeviceIdKeyL, deviceId },
+ { SenderKeyKeyL, senderKey },
+ { SessionIdKeyL, sessionId } }))
{}
EncryptedEvent::EncryptedEvent(const QJsonObject& obj)