diff --git a/lib/src/Client.dart b/lib/src/Client.dart index bdc4b254..748d3123 100644 --- a/lib/src/Client.dart +++ b/lib/src/Client.dart @@ -243,7 +243,7 @@ class Client { Future getPushrules() async { final dynamic resp = await connection.jsonRequest( type: HTTPType.GET, - action: "/client/r0/pushrules", + action: "/client/r0/pushrules/", ); if (resp is ErrorResponse) { diff --git a/lib/src/Store.dart b/lib/src/Store.dart index c098e702..13096f9e 100644 --- a/lib/src/Store.dart +++ b/lib/src/Store.dart @@ -100,6 +100,7 @@ class Store { await db.execute(RoomsScheme); await db.execute(UserScheme); await db.execute(EventsScheme); + await db.execute(NotificationsCacheScheme); } Future queryPrevBatch() async { @@ -716,7 +717,7 @@ class Store { 'UNIQUE(chat_id, matrix_id))'; /// The database scheme for the NotificationsCache class. - static final String NotificationsCache = 'CREATE TABLE IF NOT EXISTS NotificationsCache(' + + static final String NotificationsCacheScheme = 'CREATE TABLE IF NOT EXISTS NotificationsCache(' + 'id int PRIMARY KEY' 'chat_id TEXT, ' + // The chat id 'event_id TEXT, ' + // The matrix id of the Event diff --git a/test/Client_test.dart b/test/Client_test.dart index 64a5104b..8a2e9650 100644 --- a/test/Client_test.dart +++ b/test/Client_test.dart @@ -244,7 +244,7 @@ void main() { test('getPushrules', () async { final PushrulesResponse pushrules = await matrix.getPushrules(); final PushrulesResponse awaited_resp = PushrulesResponse.fromJson( - FakeMatrixApi.api["GET"]["/client/r0/pushrules"]("")); + FakeMatrixApi.api["GET"]["/client/r0/pushrules/"]("")); expect(pushrules.toJson(), awaited_resp.toJson()); }); diff --git a/test/FakeMatrixApi.dart b/test/FakeMatrixApi.dart index 7e06131a..89a7b51c 100644 --- a/test/FakeMatrixApi.dart +++ b/test/FakeMatrixApi.dart @@ -164,7 +164,7 @@ class FakeMatrixApi extends MockClient { } ] }, - "/client/r0/pushrules": (var req) => { + "/client/r0/pushrules/": (var req) => { "global": { "content": [ {