feat: Add clear cache command

This commit is contained in:
Krille Fear 2021-11-23 09:48:08 +01:00
parent 5da0180f1f
commit 921c694888
2 changed files with 9 additions and 0 deletions

View File

@ -215,6 +215,10 @@ extension CommandsClientExtension on Client {
.clearOrUseOutboundGroupSession(args.room.id, wipe: true);
return '';
});
addCommand('clearcache', (CommandArgs args) async {
await clearCache();
return '';
});
}
}

View File

@ -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);
});