@@ -40,10 +40,19 @@ * * @param exception `nil` on success, otherwise an exception */ typedef void (^mtx_client_logout_block_t)(id _Nullable exception); +/** + * @brief A block called when the room list was fetched. + * + * @param rooms An array of joined rooms, or nil on error + * @param exception An exception if fetching the room list failed + */ +typedef void (^mtx_client_room_list_block_t)( + OFArray *_Nullable rooms, id _Nullable exception); + /** * @brief A class that represents a client. */ @interface MTXClient: OFObject /** @@ -103,11 +112,18 @@ /** * @brief Logs out the device and invalidates the access token. * * @warning The client can no longer be used after this succeeded! * - * @param block The block to call when logging out succeeded or failed + * @param block A block to call when logging out succeeded or failed */ - (void)asyncLogOutWithBlock: (mtx_client_logout_block_t)block; + +/** + * @brief Fetches the list of joined rooms. + * + * @param block A block to call with the list of joined room + */ +- (void)asyncFetchRoomList: (mtx_client_room_list_block_t)block; @end OF_ASSUME_NONNULL_END