diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2019-01-13 19:23:52 +0900 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2019-01-13 19:23:52 +0900 |
commit | 23bf0e83aec1adaf81d9c50ce2385a98c20e3c93 (patch) | |
tree | 6fa9d5a34d7f5236798488ef8f0d76e57e879d55 /lib/connection.h | |
parent | d76424cb6c16cdef29761f00592db05989532a20 (diff) | |
parent | a9bdc89f66ba283859fd9ca7383a7256198174ed (diff) | |
download | libquotient-23bf0e83aec1adaf81d9c50ce2385a98c20e3c93.tar.gz libquotient-23bf0e83aec1adaf81d9c50ce2385a98c20e3c93.zip |
Merge branch 'kitsune-workaround-stuck-invites'
Diffstat (limited to 'lib/connection.h')
-rw-r--r-- | lib/connection.h | 38 |
1 files changed, 25 insertions, 13 deletions
diff --git a/lib/connection.h b/lib/connection.h index 98e8dced..9e4121f4 100644 --- a/lib/connection.h +++ b/lib/connection.h @@ -49,6 +49,7 @@ namespace QMatrixClient class DownloadFileJob; class SendToDeviceJob; class SendMessageJob; + class LeaveRoomJob; class Connection; @@ -475,14 +476,14 @@ namespace QMatrixClient SendMessageJob* sendMessage(const QString& roomId, const RoomEvent& event) const; + /** \deprecated Do not use this directly, use Room::leaveRoom() instead */ + virtual LeaveRoomJob* leaveRoom( Room* room ); + // Old API that will be abolished any time soon. DO NOT USE. /** @deprecated Use callApi<PostReceiptJob>() or Room::postReceipt() instead */ virtual PostReceiptJob* postReceipt(Room* room, RoomEvent* event) const; - /** @deprecated Use callApi<LeaveRoomJob>() or Room::leaveRoom() instead */ - virtual void leaveRoom( Room* room ); - signals: /** * @deprecated @@ -651,16 +652,27 @@ namespace QMatrixClient */ const ConnectionData* connectionData() const; - /** - * @brief Find a (possibly new) Room object for the specified id - * Use this method whenever you need to find a Room object in - * the local list of rooms. Note that this does not interact with - * the server; in particular, does not automatically create rooms - * on the server. - * @return a pointer to a Room object with the specified id; nullptr - * if roomId is empty or roomFactory() failed to create a Room object. - */ - Room* provideRoom(const QString& roomId, JoinState joinState); + /** Get a Room object for the given id in the given state + * + * Use this method when you need a Room object in the local list + * of rooms, with the given state. Note that this does not interact + * with the server; in particular, does not automatically create + * rooms on the server. This call performs necessary join state + * transitions; e.g., if it finds a room in Invite but + * `joinState == JoinState::Join` then the Invite room object + * will be deleted and a new room object with Join state created. + * In contrast, switching between Join and Leave happens within + * the same object. + * \param roomId room id (not alias!) + * \param joinState desired (target) join state of the room; if + * omitted, any state will be found and return unchanged, or a + * new Join room created. + * @return a pointer to a Room object with the specified id and the + * specified state; nullptr if roomId is empty or if roomFactory() + * failed to create a Room object. + */ + Room* provideRoom(const QString& roomId, + Omittable<JoinState> joinState = none); /** * Completes loading sync data. |