Add key exporting to account settings

This commit is contained in:
miruka
2019-09-07 19:17:32 -04:00
parent 11486ab51d
commit a87f98fae0
5 changed files with 64 additions and 16 deletions

View File

@@ -338,6 +338,17 @@ class MatrixClient(nio.AsyncClient):
await self.retry_decrypting_events()
async def export_keys(self, outfile: str, passphrase: str) -> None:
path = Path(outfile)
path.parent.mkdir(parents=True, exist_ok=True)
# Remove any existing file
# (the QML dialog asks the user if he wants to overwrite before this)
path.unlink()
await super().export_keys(outfile, passphrase)
async def clear_import_error(self) -> None:
self.models[Account][self.user_id].import_error = ("", "", "")