aboutsummaryrefslogtreecommitdiff
path: root/lib/events
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2018-11-17 19:52:27 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2018-11-17 19:52:27 +0900
commit760c42bbb6027bfc6ebeb70a3a77608378d7c510 (patch)
tree775b57182fcb3f9e4c664f3d838e94730e0c32a5 /lib/events
parentc94ad527ed94a4c1ca368dc8c8c59e490b907649 (diff)
downloadlibquotient-760c42bbb6027bfc6ebeb70a3a77608378d7c510.tar.gz
libquotient-760c42bbb6027bfc6ebeb70a3a77608378d7c510.zip
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.
Diffstat (limited to 'lib/events')
-rw-r--r--lib/events/stateevent.cpp5
-rw-r--r--lib/events/stateevent.h1
2 files changed, 6 insertions, 0 deletions
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())
diff --git a/lib/events/stateevent.h b/lib/events/stateevent.h
index d50500f2..d4a7e8b3 100644
--- a/lib/events/stateevent.h
+++ b/lib/events/stateevent.h
@@ -30,6 +30,7 @@ namespace QMatrixClient {
~StateEventBase() override = default;
bool isStateEvent() const override { return true; }
+ QString replacedState() const;
void dumpTo(QDebug dbg) const override;
virtual bool repeatsState() const;