aboutsummaryrefslogtreecommitdiff
path: root/lib/events/encryptedevent.cpp
diff options
context:
space:
mode:
authorAlexey Rusakov <Kitsune-Ral@users.sf.net>2022-07-12 14:56:20 +0200
committerAlexey Rusakov <Kitsune-Ral@users.sf.net>2022-07-12 14:56:20 +0200
commit73167a23212541ff6aeaeb901d7dfe636badc6e8 (patch)
treef889b50746fd393d005552cd6c3580449fc78166 /lib/events/encryptedevent.cpp
parent607489a2e6a3e3238eac0178f5c7bbc70f178f46 (diff)
parente7dee15531ad357bd33ac546fb1b9332a5c1260c (diff)
downloadlibquotient-73167a23212541ff6aeaeb901d7dfe636badc6e8.tar.gz
libquotient-73167a23212541ff6aeaeb901d7dfe636badc6e8.zip
Merge branch 'kitsune/converters-upgrade' into dev
Diffstat (limited to 'lib/events/encryptedevent.cpp')
-rw-r--r--lib/events/encryptedevent.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/events/encryptedevent.cpp b/lib/events/encryptedevent.cpp
index c97ccc16..ec00ad4c 100644
--- a/lib/events/encryptedevent.cpp
+++ b/lib/events/encryptedevent.cpp
@@ -49,14 +49,16 @@ RoomEventPtr EncryptedEvent::createDecrypted(const QString &decrypted) const
eventObject["event_id"] = id();
eventObject["sender"] = senderId();
eventObject["origin_server_ts"] = originTimestamp().toMSecsSinceEpoch();
- if (const auto relatesToJson = contentPart("m.relates_to"_ls); !relatesToJson.isUndefined()) {
+ if (const auto relatesToJson = contentPart<QJsonObject>("m.relates_to"_ls);
+ !relatesToJson.isEmpty()) {
auto content = eventObject["content"].toObject();
- content["m.relates_to"] = relatesToJson.toObject();
+ content["m.relates_to"] = relatesToJson;
eventObject["content"] = content;
}
- if (const auto redactsJson = unsignedPart("redacts"_ls); !redactsJson.isUndefined()) {
+ if (const auto redactsJson = unsignedPart<QString>("redacts"_ls);
+ !redactsJson.isEmpty()) {
auto unsign = eventObject["unsigned"].toObject();
- unsign["redacts"] = redactsJson.toString();
+ unsign["redacts"] = redactsJson;
eventObject["unsigned"] = unsign;
}
return loadEvent<RoomEvent>(eventObject);