aboutsummaryrefslogtreecommitdiff
path: root/lib/room.h
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2019-12-09 18:30:36 +0300
committerKitsune Ral <Kitsune-Ral@users.sf.net>2019-12-09 18:35:23 +0300
commit3e81ba0da47278f383ce8c329010602f84a50482 (patch)
treef7ab4e3a69ffa60527cd963b22db0767ebb3fc65 /lib/room.h
parent608e252bae9cf8cf763e05363bfacf5e1760134f (diff)
downloadlibquotient-3e81ba0da47278f383ce8c329010602f84a50482.tar.gz
libquotient-3e81ba0da47278f383ce8c329010602f84a50482.zip
Room::predecessor() and Room::successor()
Diffstat (limited to 'lib/room.h')
-rw-r--r--lib/room.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/room.h b/lib/room.h
index 2c958033..fa3c6ff3 100644
--- a/lib/room.h
+++ b/lib/room.h
@@ -167,7 +167,22 @@ public:
QString version() const;
bool isUnstable() const;
QString predecessorId() const;
+ /// Room predecessor
+ /** This function validates that the predecessor has a tombstone and
+ * the tombstone refers to the current room. If that's not the case,
+ * or if the predecessor is in a join state not matching \p stateFilter,
+ * the function returns nullptr.
+ */
+ Room* predecessor(JoinStates statesFilter = JoinState::Invite
+ | JoinState::Join) const;
QString successorId() const;
+ /// Room successor
+ /** This function validates that the successor room's creation event
+ * refers to the current room. If that's not the case, or if the successor
+ * is in a join state not matching \p stateFilter, it returns nullptr.
+ */
+ Room* successor(JoinStates statesFilter = JoinState::Invite
+ | JoinState::Join) const;
QString name() const;
/// Room aliases defined on the current user's server
/// \sa remoteAliases, setLocalAliases