aboutsummaryrefslogtreecommitdiff
path: root/lib/connection.h
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2019-09-29 18:20:54 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2019-09-29 23:35:54 +0900
commit508f4362b7b5e1863153cca6fe6756adedfa33ee (patch)
tree39fa11759b65e1ff8570ac58c1482d908e758782 /lib/connection.h
parent7802bcb4dd44c7523cbc687b52dd2e65b900c636 (diff)
downloadlibquotient-508f4362b7b5e1863153cca6fe6756adedfa33ee.tar.gz
libquotient-508f4362b7b5e1863153cca6fe6756adedfa33ee.zip
Connection: allRooms(), rooms(), roomsCount(); deprecate roomMap()
Closes #354.
Diffstat (limited to 'lib/connection.h')
-rw-r--r--lib/connection.h29
1 files changed, 28 insertions, 1 deletions
diff --git a/lib/connection.h b/lib/connection.h
index b4b16679..1f1d4cd5 100644
--- a/lib/connection.h
+++ b/lib/connection.h
@@ -135,12 +135,39 @@ public:
explicit Connection(const QUrl& server, QObject* parent = nullptr);
~Connection() override;
- /** Get all Invited and Joined rooms
+ /// Get all Invited and Joined rooms
+ /*!
* \return a hashmap from a composite key - room name and whether
* it's an Invite rather than Join - to room pointers
+ * \sa allRooms, rooms, roomsWithTag
*/
+ [[deprecated("Use allRooms(), roomsWithTag() or rooms(joinStates) instead")]]
QHash<QPair<QString, bool>, Room*> roomMap() const;
+ /// Get all rooms known within this Connection
+ /*!
+ * This includes Invite, Join and Leave rooms, in no particular order.
+ * \note Leave rooms will only show up in the list if they have been left
+ * in the same running session. The library doesn't cache left rooms
+ * between runs and it doesn't retrieve the full list of left rooms
+ * from the server.
+ * \sa rooms, room, roomsWithTag
+ */
+ Q_INVOKABLE QVector<Room*> allRooms() const;
+
+ /// Get rooms that have either of the given join state(s)
+ /*!
+ * This method returns, in no particular order, rooms which join state
+ * matches the mask passed in \p joinStates.
+ * \note Similar to allRooms(), this won't retrieve the full list of
+ * Leave rooms from the server.
+ * \sa allRooms, room, roomsWithTag
+ */
+ Q_INVOKABLE QVector<Room*> rooms(JoinStates joinStates) const;
+
+ /// Get the total number of rooms in the given join state(s)
+ Q_INVOKABLE int roomsCount(JoinStates joinStates) const;
+
/** Check whether the account has data of the given type
* Direct chats map is not supported by this method _yet_.
*/