Index: src/MTXClient.h ================================================================== --- src/MTXClient.h +++ src/MTXClient.h @@ -114,16 +114,16 @@ * * @warning The client can no longer be used after this succeeded! * * @param block A block to call when logging out succeeded or failed */ -- (void)asyncLogOutWithBlock: (mtx_client_logout_block_t)block; +- (void)logOutWithBlock: (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; +- (void)fetchRoomListWithBlock: (mtx_client_room_list_block_t)block; @end OF_ASSUME_NONNULL_END Index: src/MTXClient.m ================================================================== --- src/MTXClient.m +++ src/MTXClient.m @@ -76,12 +76,12 @@ @"user": user }, @"password": password }; - [request asyncPerformWithBlock: ^ (mtx_response_t response, - int statusCode, id exception) { + [request performWithBlock: ^ (mtx_response_t response, int statusCode, + id exception) { if (exception != nil) { block(nil, exception); return; } @@ -184,18 +184,18 @@ return [MTXRequest requestWithPath: path accessToken: _accessToken homeserver: _homeserver]; } -- (void)asyncLogOutWithBlock: (mtx_client_logout_block_t)block +- (void)logOutWithBlock: (mtx_client_logout_block_t)block { void *pool = objc_autoreleasePoolPush(); MTXRequest *request = [self requestWithPath: @"/_matrix/client/r0/logout"]; request.method = OF_HTTP_REQUEST_METHOD_POST; - [request asyncPerformWithBlock: ^ (mtx_response_t response, - int statusCode, id exception) { + [request performWithBlock: ^ (mtx_response_t response, int statusCode, + id exception) { if (exception != nil) { block(exception); return; } @@ -211,17 +211,17 @@ }]; objc_autoreleasePoolPop(pool); } -- (void)asyncFetchRoomList: (mtx_client_room_list_block_t)block +- (void)fetchRoomListWithBlock: (mtx_client_room_list_block_t)block { void *pool = objc_autoreleasePoolPush(); MTXRequest *request = [self requestWithPath: @"/_matrix/client/r0/joined_rooms"]; - [request asyncPerformWithBlock: ^ (mtx_response_t response, - int statusCode, id exception) { + [request performWithBlock: ^ (mtx_response_t response, int statusCode, + id exception) { if (exception != nil) { block(nil, exception); return; } Index: src/MTXRequest.h ================================================================== --- src/MTXRequest.h +++ src/MTXRequest.h @@ -104,9 +104,9 @@ * @brief Performs the request and calls the specified block once the request * succeeded or failed. * * @param block The block to call once the request succeeded or failed */ -- (void)asyncPerformWithBlock: (mtx_request_block_t)block; +- (void)performWithBlock: (mtx_request_block_t)block; @end OF_ASSUME_NONNULL_END Index: src/MTXRequest.m ================================================================== --- src/MTXRequest.m +++ src/MTXRequest.m @@ -85,11 +85,11 @@ return [OFString stringWithUTF8String: _body.items length: _body.count] .objectByParsingJSON; } -- (void)asyncPerformWithBlock: (mtx_request_block_t)block +- (void)performWithBlock: (mtx_request_block_t)block { void *pool = objc_autoreleasePoolPush(); if (_block != nil) /* Not the best exception to indicate it's already in-flight. */ Index: tests/tests.m ================================================================== --- tests/tests.m +++ tests/tests.m @@ -63,12 +63,12 @@ }]; } - (void)fetchRoomList { - [_client asyncFetchRoomList: ^ (OFArray *rooms, - id exception) { + [_client fetchRoomListWithBlock: ^ (OFArray *rooms, + id exception) { if (exception != nil) { of_log(@"Failed to fetch room list: %@", exception); [OFApplication terminateWithStatus: 1]; } @@ -78,11 +78,11 @@ }]; } - (void)logOut { - [_client asyncLogOutWithBlock: ^ (id exception) { + [_client logOutWithBlock: ^ (id exception) { if (exception != nil) { of_log(@"Failed to log out: %@\n", exception); [OFApplication terminateWithStatus: 1]; }