diff --git a/lib/src/utils/commands_extension.dart b/lib/src/utils/commands_extension.dart index 731c52a2..038ab4e4 100644 --- a/lib/src/utils/commands_extension.dart +++ b/lib/src/utils/commands_extension.dart @@ -215,6 +215,10 @@ extension CommandsClientExtension on Client { .clearOrUseOutboundGroupSession(args.room.id, wipe: true); return ''; }); + addCommand('clearcache', (CommandArgs args) async { + await clearCache(); + return ''; + }); } } diff --git a/test/commands_test.dart b/test/commands_test.dart index 87e94918..30ae47f2 100644 --- a/test/commands_test.dart +++ b/test/commands_test.dart @@ -311,6 +311,11 @@ void main() { } }); + test('create', () async { + await room.sendTextEvent('/clearcache'); + expect(room.client.prevBatch, null); + }); + test('dispose client', () async { await client.dispose(closeDatabase: true); });