accounts.json: support new "enabled" key

Specifying false will cause Mirage to ignore an account and not
log it in on startup.
Defaults to true when adding new accounts or if not present.
This commit is contained in:
miruka 2020-04-05 15:04:40 -04:00
parent 80ac8896d8
commit b2cfc27ce2
2 changed files with 2 additions and 0 deletions

View File

@ -153,6 +153,7 @@ class Backend:
return await asyncio.gather(*(
resume(uid, info)
for uid, info in (await self.saved_accounts.read()).items()
if info.get("enabled", True)
))

View File

@ -190,6 +190,7 @@ class Accounts(JSONDataFile):
"homeserver": client.homeserver,
"token": client.access_token,
"device_id": client.device_id,
"enabled": True,
},
})