aboutsummaryrefslogtreecommitdiff
path: root/lib/room.h
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2019-12-09 18:14:43 +0300
committerKitsune Ral <Kitsune-Ral@users.sf.net>2019-12-09 18:23:04 +0300
commit105ff3874baf0792616e1b330ce97f0b725adaf5 (patch)
treeefb735f20b542c2fd4c342a500b603ebe64ba357 /lib/room.h
parente829f867c14cb51e89e4d10550f2f41329c14ba8 (diff)
downloadlibquotient-105ff3874baf0792616e1b330ce97f0b725adaf5.tar.gz
libquotient-105ff3874baf0792616e1b330ce97f0b725adaf5.zip
Room: more doc-comments
Diffstat (limited to 'lib/room.h')
-rw-r--r--lib/room.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/room.h b/lib/room.h
index 7e419823..2c958033 100644
--- a/lib/room.h
+++ b/lib/room.h
@@ -442,6 +442,10 @@ public:
Q_INVOKABLE const Quotient::StateEventBase*
getCurrentState(const QString& evtType, const QString& stateKey = {}) const;
+ /// Get a state event with the given event type and state key
+ /*! This is a typesafe overload that accepts a C++ event type instead of
+ * its Matrix name.
+ */
template <typename EvT>
const EvT* getCurrentState(const QString& stateKey = {}) const
{
@@ -453,6 +457,14 @@ public:
return evt;
}
+ /// Set a state event of the given type with the given arguments
+ /*! This typesafe overload attempts to send a state event with the type
+ * \p EvT and the content defined by \p args. Specifically, the function
+ * creates a temporary object of type \p EvT passing \p args to
+ * the constructor, and sends a request to the homeserver using
+ * the Matrix event type defined by \p EvT and the event content produced
+ * via EvT::contentJson().
+ */
template <typename EvT, typename... ArgTs>
auto setState(ArgTs&&... args) const
{