Index: src/MTXSQLite3Storage.h ================================================================== --- src/MTXSQLite3Storage.h +++ src/MTXSQLite3Storage.h @@ -25,20 +25,20 @@ */ @interface MTXSQLite3Storage: OFObject /** * @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 Index: src/MTXSQLite3Storage.m ================================================================== --- src/MTXSQLite3Storage.m +++ src/MTXSQLite3Storage.m @@ -27,23 +27,23 @@ SL3PreparedStatement *_joinedRoomsAddStatement; SL3PreparedStatement *_joinedRoomsRemoveStatement; 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]; _nextBatchSetStatement = [[_conn prepareStatement: @"INSERT OR REPLACE INTO next_batch (\n" @@ -132,11 +132,11 @@ if (![_nextBatchGetStatement step]) return nil; OFString *nextBatch = - [_nextBatchGetStatement.rowDictionary[@"next_batch"] retain]; + [_nextBatchGetStatement.currentRowDictionary[@"next_batch"] retain]; objc_autoreleasePoolPop(pool); return [nextBatch autorelease]; } @@ -177,12 +177,12 @@ [_joinedRoomsGetStatement reset]; [_joinedRoomsGetStatement bindWithDictionary: @{ @"$user_id": userID }]; while ([_joinedRoomsGetStatement step]) [joinedRooms addObject: - _joinedRoomsGetStatement.rowDictionary[@"room_id"]]; + _joinedRoomsGetStatement.currentRowDictionary[@"room_id"]]; objc_autoreleasePoolPop(pool); return [joinedRooms autorelease]; } @end Index: tests/Tests.m ================================================================== --- tests/Tests.m +++ tests/Tests.m @@ -43,12 +43,13 @@ @"the environment!\n"]; [OFApplication terminateWithStatus: 1]; } 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 storage: storage block: ^ (MTXClient *client, id exception) {