diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2020-11-15 21:51:51 +0100 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2020-11-15 21:51:51 +0100 |
commit | 52cab4b11bdd48cd87e04c01b12c698ec4145e6d (patch) | |
tree | f8b44dd9c585606b4ac229c396ef914d5950fd47 /lib/events/roomevent.cpp | |
parent | 5b1bfc102fccd4e57893b34bf2b0a14ba6a9f577 (diff) | |
download | libquotient-52cab4b11bdd48cd87e04c01b12c698ec4145e6d.tar.gz libquotient-52cab4b11bdd48cd87e04c01b12c698ec4145e6d.zip |
Cleanup across event classes
In particular: removed unnecessary #includes, deprecated and no more
used constructs, replaced stored members with dynamic generation
from JSON (TypingEvent and, especially promising for performance,
ReceiptEvent)
Diffstat (limited to 'lib/events/roomevent.cpp')
-rw-r--r-- | lib/events/roomevent.cpp | 5 |
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()); } |