Adjust to ObjFW changes

FossilOrigin-Name: 531eb84cf5c27b39f7701dfa446886e2962aad9a8b60c3623e3b70833b18c592
This commit is contained in:
Jonathan Schleifer 2024-07-15 20:31:53 +00:00
parent 0166881d65
commit 4252cbf3f2
10 changed files with 69 additions and 55 deletions

View file

@ -30,7 +30,7 @@
+ (instancetype)requestWithPath: (OFString *)path
accessToken: (OFString *)accessToken
homeserver: (OFURL *)homeserver
homeserver: (OFIRI *)homeserver
{
return [[[self alloc] initWithPath: path
accessToken: accessToken
@ -39,7 +39,7 @@
- (instancetype)initWithPath: (OFString *)path
accessToken: (OFString *)accessToken
homeserver: (OFURL *)homeserver
homeserver: (OFIRI *)homeserver
{
self = [super init];
@ -91,11 +91,11 @@
if (_block != nil)
/* Not the best exception to indicate it's already in-flight. */
@throw [OFAlreadyConnectedException exception];
@throw [OFAlreadyOpenException exceptionWithObject: self];
OFMutableURL *requestURL = [[_homeserver mutableCopy] autorelease];
requestURL.path = _path;
requestURL.queryDictionary = _query;
OFMutableIRI *requestIRI = [[_homeserver mutableCopy] autorelease];
requestIRI.path = _path;
requestIRI.queryItems = _queryItems;
OFMutableDictionary *headers = [OFMutableDictionary dictionary];
headers[@"User-Agent"] = @"ObjMatrix";
@ -105,7 +105,7 @@
if (_body != nil)
headers[@"Content-Length"] = @(_body.count).stringValue;
OFHTTPRequest *request = [OFHTTPRequest requestWithURL: requestURL];
OFHTTPRequest *request = [OFHTTPRequest requestWithIRI: requestIRI];
request.method = _method;
request.headers = headers;