aboutsummaryrefslogtreecommitdiff
path: root/lib/events/stateevent.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/events/stateevent.cpp')
-rw-r--r--lib/events/stateevent.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/events/stateevent.cpp b/lib/events/stateevent.cpp
index fd5d2642..fd8079be 100644
--- a/lib/events/stateevent.cpp
+++ b/lib/events/stateevent.cpp
@@ -28,3 +28,18 @@ bool StateEventBase::repeatsState() const
const auto prevContentJson = unsignedJson().value(PrevContentKeyL);
return fullJson().value(ContentKeyL) == prevContentJson;
}
+
+QString StateEventBase::replacedState() const
+{
+ return unsignedJson().value("replaces_state"_ls).toString();
+}
+
+void StateEventBase::dumpTo(QDebug dbg) const
+{
+ if (!stateKey().isEmpty())
+ dbg << '<' << stateKey() << "> ";
+ if (unsignedJson().contains(PrevContentKeyL))
+ dbg << QJsonDocument(unsignedJson()[PrevContentKeyL].toObject())
+ .toJson(QJsonDocument::Compact) << " -> ";
+ RoomEvent::dumpTo(dbg);
+}