diff --git a/lib/src/client.dart b/lib/src/client.dart index f7141b76..8033f54c 100644 --- a/lib/src/client.dart +++ b/lib/src/client.dart @@ -276,7 +276,7 @@ class Client extends MatrixApi { } /// Searches in the local cache for the given room and returns null if not - /// found. If you have loaded the [archive] before, it can also return + /// found. If you have loaded the [loadArchive()] before, it can also return /// archived rooms. Room getRoomById(String id) { for (final room in [...rooms, ..._archivedRooms]) { @@ -651,7 +651,10 @@ class Client extends MatrixApi { final List _archivedRooms = []; - Future> get archive async { + @Deprecated('Use [loadArchive()] instead.') + Future> get archive => loadArchive(); + + Future> loadArchive() async { _archivedRooms.clear(); final syncResp = await sync( filter: '{"room":{"include_leave":true,"timeline":{"limit":10}}}', diff --git a/test/client_test.dart b/test/client_test.dart index a8010055..52d9584b 100644 --- a/test/client_test.dart +++ b/test/client_test.dart @@ -351,7 +351,7 @@ void main() { }); test('get archive', () async { - final archive = await matrix.archive; + final archive = await matrix.loadArchive(); await Future.delayed(Duration(milliseconds: 50)); expect(archive.length, 2);