diff --git a/src/MTXSQLite3Storage.h b/src/MTXSQLite3Storage.h index 3fdbc71..1fbcdd0 100644 --- a/src/MTXSQLite3Storage.h +++ b/src/MTXSQLite3Storage.h @@ -27,18 +27,18 @@ OF_ASSUME_NONNULL_BEGIN /** * @brief Creates a new SQLite3-based storage for @ref MTXClient. * - * @param path The path for the SQLite3 database + * @param IRI The IRI for the SQLite3 database * @return An autoreleased MTXSQLite3Storage */ -+ (instancetype)storageWithPath: (OFString *)path; ++ (instancetype)storageWithIRI: (OFIRI *)IRI; /** * @brief Initializes an already allocated MTXSQLite3Storage. * - * @param path The path for the SQLite3 database + * @param IRI The IRI for the SQLite3 database * @return An initialized MTXSQLite3Storage */ -- (instancetype)initWithPath: (OFString *)path OF_DESIGNATED_INITIALIZER; +- (instancetype)initWithIRI: (OFIRI *)IRI OF_DESIGNATED_INITIALIZER; @end OF_ASSUME_NONNULL_END diff --git a/src/MTXSQLite3Storage.m b/src/MTXSQLite3Storage.m index 7a58851..075baa4 100644 --- a/src/MTXSQLite3Storage.m +++ b/src/MTXSQLite3Storage.m @@ -29,19 +29,19 @@ SL3PreparedStatement *_joinedRoomsGetStatement; } -+ (instancetype)storageWithPath: (OFString *)path ++ (instancetype)storageWithIRI: (OFIRI *)IRI { - return [[[self alloc] initWithPath: path] autorelease]; + return [[[self alloc] initWithIRI: IRI] autorelease]; } -- (instancetype)initWithPath: (OFString *)path +- (instancetype)initWithIRI: (OFIRI *)IRI { self = [super init]; @try { void *pool = objc_autoreleasePoolPush(); - _conn = [[SL3Connection alloc] initWithPath: path]; + _conn = [[SL3Connection alloc] initWithIRI: IRI]; [self createTables]; @@ -134,7 +134,7 @@ return nil; OFString *nextBatch = - [_nextBatchGetStatement.rowDictionary[@"next_batch"] retain]; + [_nextBatchGetStatement.currentRowDictionary[@"next_batch"] retain]; objc_autoreleasePoolPop(pool); @@ -179,7 +179,7 @@ while ([_joinedRoomsGetStatement step]) [joinedRooms addObject: - _joinedRoomsGetStatement.rowDictionary[@"room_id"]]; + _joinedRoomsGetStatement.currentRowDictionary[@"room_id"]]; objc_autoreleasePoolPop(pool); diff --git a/tests/Tests.m b/tests/Tests.m index ef28874..986e26f 100644 --- a/tests/Tests.m +++ b/tests/Tests.m @@ -45,8 +45,9 @@ OF_APPLICATION_DELEGATE(Tests) } OFIRI *homeserver = [OFIRI IRIWithString: environment[@"OBJMATRIX_HS"]]; + OFIRI *storageIRI = [OFIRI fileIRIWithPath: @"tests.db"]; id storage = - [MTXSQLite3Storage storageWithPath: @"tests.db"]; + [MTXSQLite3Storage storageWithIRI: storageIRI]; [MTXClient logInWithUser: environment[@"OBJMATRIX_USER"] password: environment[@"OBJMATRIX_PASS"] homeserver: homeserver