diff --git a/src/MTXClient.h b/src/MTXClient.h index e52170e..44198e3 100644 --- a/src/MTXClient.h +++ b/src/MTXClient.h @@ -116,14 +116,14 @@ typedef void (^mtx_client_room_list_block_t)( * * @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 diff --git a/src/MTXClient.m b/src/MTXClient.m index 0d0171f..01037f8 100644 --- a/src/MTXClient.m +++ b/src/MTXClient.m @@ -78,8 +78,8 @@ validateHomeserver(OFURL *homeserver) @"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; @@ -186,14 +186,14 @@ validateHomeserver(OFURL *homeserver) 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; @@ -213,13 +213,13 @@ validateHomeserver(OFURL *homeserver) 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; diff --git a/src/MTXRequest.h b/src/MTXRequest.h index 8e72a4e..303f516 100644 --- a/src/MTXRequest.h +++ b/src/MTXRequest.h @@ -106,7 +106,7 @@ typedef void (^mtx_request_block_t)(mtx_response_t _Nullable response, * * @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 diff --git a/src/MTXRequest.m b/src/MTXRequest.m index 8ed625c..0b8dd21 100644 --- a/src/MTXRequest.m +++ b/src/MTXRequest.m @@ -87,7 +87,7 @@ .objectByParsingJSON; } -- (void)asyncPerformWithBlock: (mtx_request_block_t)block +- (void)performWithBlock: (mtx_request_block_t)block { void *pool = objc_autoreleasePoolPush(); diff --git a/tests/tests.m b/tests/tests.m index 87f0081..b7cff75 100644 --- a/tests/tests.m +++ b/tests/tests.m @@ -65,8 +65,8 @@ OF_APPLICATION_DELEGATE(Tests) - (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]; @@ -80,7 +80,7 @@ OF_APPLICATION_DELEGATE(Tests) - (void)logOut { - [_client asyncLogOutWithBlock: ^ (id exception) { + [_client logOutWithBlock: ^ (id exception) { if (exception != nil) { of_log(@"Failed to log out: %@\n", exception); [OFApplication terminateWithStatus: 1];