From 760c42bbb6027bfc6ebeb70a3a77608378d7c510 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Sat, 17 Nov 2018 19:52:27 +0900 Subject: StateEventBase::replacedState() Brings event id of the state event that was in effect before this one arrived. This key is not specced but it's used in the wild since forever. --- lib/events/stateevent.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/events/stateevent.cpp') diff --git a/lib/events/stateevent.cpp b/lib/events/stateevent.cpp index 280c334c..fd8079be 100644 --- a/lib/events/stateevent.cpp +++ b/lib/events/stateevent.cpp @@ -29,6 +29,11 @@ bool StateEventBase::repeatsState() const 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()) -- cgit v1.2.3