From b2cfc27ce276db16f94e1fc354895f2a1d174579 Mon Sep 17 00:00:00 2001 From: miruka Date: Sun, 5 Apr 2020 15:04:40 -0400 Subject: [PATCH] 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. --- src/backend/backend.py | 1 + src/backend/user_files.py | 1 + 2 files changed, 2 insertions(+) diff --git a/src/backend/backend.py b/src/backend/backend.py index 2f79e925..d5e3409a 100644 --- a/src/backend/backend.py +++ b/src/backend/backend.py @@ -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) )) diff --git a/src/backend/user_files.py b/src/backend/user_files.py index 760e1606..711e4337 100644 --- a/src/backend/user_files.py +++ b/src/backend/user_files.py @@ -190,6 +190,7 @@ class Accounts(JSONDataFile): "homeserver": client.homeserver, "token": client.access_token, "device_id": client.device_id, + "enabled": True, }, })