Merge branch 'krille/add-clear-cache-command' into 'main'

feat: Add clear cache command

See merge request famedly/company/frontend/famedlysdk!908
This commit is contained in:
Sorunome 2021-11-23 13:06:53 +00:00
commit 17d8b4d25f
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); .clearOrUseOutboundGroupSession(args.room.id, wipe: true);
return ''; 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 { test('dispose client', () async {
await client.dispose(closeDatabase: true); await client.dispose(closeDatabase: true);
}); });