Differences From Artifact [2e0008f3e6]:
- File src/MTXClient.m — part of check-in [71e1a46c8f] at 2020-10-03 17:20:34 on branch trunk — More validation of server responses (user: js, size: 6770) [annotate] [blame] [check-ins using]
To Artifact [fbae956347]:
- File
src/MTXClient.m
— part of check-in
[d18fbd29fb]
at
2020-10-03 17:23:45
on branch trunk
— Get rid of async prefix
All operations are async anyway. (user: js, size: 6760) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
74 75 76 77 78 79 80 | @"identifier": @{ @"type": @"m.id.user", @"user": user }, @"password": password }; | | | | 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 | @"identifier": @{ @"type": @"m.id.user", @"user": user }, @"password": password }; [request performWithBlock: ^ (mtx_response_t response, int statusCode, id exception) { if (exception != nil) { block(nil, exception); return; } if (statusCode != 200) { id exception = [MTXLoginFailedException |
︙ | ︙ | |||
182 183 184 185 186 187 188 | - (MTXRequest *)requestWithPath: (OFString *)path { return [MTXRequest requestWithPath: path accessToken: _accessToken homeserver: _homeserver]; } | | | | | | | | 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 | - (MTXRequest *)requestWithPath: (OFString *)path { return [MTXRequest requestWithPath: path accessToken: _accessToken homeserver: _homeserver]; } - (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 performWithBlock: ^ (mtx_response_t response, int statusCode, id exception) { if (exception != nil) { block(exception); return; } if (statusCode != 200) { block([MTXLogoutFailedException exceptionWithClient: self statusCode: statusCode response: response]); return; } block(nil); }]; objc_autoreleasePoolPop(pool); } - (void)fetchRoomListWithBlock: (mtx_client_room_list_block_t)block { void *pool = objc_autoreleasePoolPush(); MTXRequest *request = [self requestWithPath: @"/_matrix/client/r0/joined_rooms"]; [request performWithBlock: ^ (mtx_response_t response, int statusCode, id exception) { if (exception != nil) { block(nil, exception); return; } if (statusCode != 200) { block(nil, [MTXFetchRoomListFailedException |
︙ | ︙ |