diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-11-04 16:07:53 +0900 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-11-04 16:07:53 +0900 |
commit | 9993a0ea50165fd70f75b68c329ea045fb51d7f4 (patch) | |
tree | 6c56bc17799273cb3693a2b435d69e361e2c04ff /lib/events/stateevent.cpp | |
parent | f3221451ce29c3b571e08fe3ce51a49f252029e5 (diff) | |
download | libquotient-9993a0ea50165fd70f75b68c329ea045fb51d7f4.tar.gz libquotient-9993a0ea50165fd70f75b68c329ea045fb51d7f4.zip |
Support dumping Events to QDebug
Diffstat (limited to 'lib/events/stateevent.cpp')
-rw-r--r-- | lib/events/stateevent.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/events/stateevent.cpp b/lib/events/stateevent.cpp index fd5d2642..ea7533c5 100644 --- a/lib/events/stateevent.cpp +++ b/lib/events/stateevent.cpp @@ -28,3 +28,11 @@ bool StateEventBase::repeatsState() const const auto prevContentJson = unsignedJson().value(PrevContentKeyL); return fullJson().value(ContentKeyL) == prevContentJson; } + +void StateEventBase::dumpTo(QDebug dbg) const +{ + if (unsignedJson().contains(PrevContentKeyL)) + dbg << QJsonDocument(unsignedJson()[PrevContentKeyL].toObject()) + .toJson(QJsonDocument::Compact) << " -> "; + RoomEvent::dumpTo(dbg); +} |