Add missing environmental variable checks

Encryption keys, themes and general config dir (if used) were stored in
the default directories even if Moment-specific environmental variables
were present.
This commit is contained in:
Maze
2022-01-29 22:35:07 +01:00
parent 602dcbf15f
commit 4fa44f7510
2 changed files with 11 additions and 3 deletions

View File

@@ -165,7 +165,10 @@ class MatrixClient(nio.AsyncClient):
device_id: Optional[str] = None,
) -> None:
store = Path(backend.appdirs.user_data_dir) / "encryption"
store = Path(
os.environ.get("MOMENT_DATA_DIR") or backend.appdirs.user_data_dir,
) / "encryption"
store.mkdir(parents=True, exist_ok=True)
proxy: Optional[str]