diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2020-03-26 22:49:06 +0100 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2020-03-26 22:52:01 +0100 |
commit | 2216c5f844e5227976f4b0a8208c6c7e834934ae (patch) | |
tree | 485f087033ef9789d0c8469538ee62ec1ff1336f /lib/connection.h | |
parent | 123d58fc3c29d8e9adbb5b654df53d5cbb0a32fa (diff) | |
download | libquotient-2216c5f844e5227976f4b0a8208c6c7e834934ae.tar.gz libquotient-2216c5f844e5227976f4b0a8208c6c7e834934ae.zip |
Connection: allRooms(), rooms(), roomsCount(); deprecate roomMap()
Backport of #354.
Diffstat (limited to 'lib/connection.h')
-rw-r--r-- | lib/connection.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/lib/connection.h b/lib/connection.h index 33f9bfba..b0dfeb5e 100644 --- a/lib/connection.h +++ b/lib/connection.h @@ -154,11 +154,38 @@ namespace QMatrixClient virtual ~Connection(); /** Get all Invited and Joined rooms + * + * \deprecated + * Use allRooms(), roomsWithTag(), or rooms(JoinStates) instead * \return a hashmap from a composite key - room name and whether * it's an Invite rather than Join - to room pointers */ 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_. */ |