aboutsummaryrefslogtreecommitdiff
path: root/lib/events/roomevent.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/events/roomevent.cpp')
-rw-r--r--lib/events/roomevent.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/events/roomevent.cpp b/lib/events/roomevent.cpp
index 3d87ef18..a2dbc07d 100644
--- a/lib/events/roomevent.cpp
+++ b/lib/events/roomevent.cpp
@@ -34,9 +34,8 @@ RoomEvent::RoomEvent(Type type, event_mtype_t matrixType,
RoomEvent::RoomEvent(Type type, const QJsonObject& json) : Event(type, json)
{
- const auto unsignedData = json[UnsignedKeyL].toObject();
- const auto redaction = unsignedData[RedactedCauseKeyL];
- if (redaction.isObject())
+ if (const auto redaction = unsignedJson()[RedactedCauseKeyL];
+ redaction.isObject())
_redactedBecause = makeEvent<RedactionEvent>(redaction.toObject());
}