feat: allow plain domain in dcaccount: scheme

This is similar to old `dcaccount:` with URL,
but creates a 9-character username on the client
and avoids making an HTTPS request.

The scheme is reused to avoid the apps
needing to register for the new scheme.

`http` support is removed because it was
not working already, there is a check
that the scheme is `https` when the URL
is actually used and the core has
no way to make HTTP requests without TLS.
This commit is contained in:
link2xt
2025-10-27 17:41:39 +00:00
committed by l
parent 9f0d106818
commit 05ba206c5a
4 changed files with 54 additions and 58 deletions

View File

@@ -45,8 +45,8 @@ class ACFactory:
"""Create a new configured account."""
addr, password = self.get_credentials()
account = self.get_unconfigured_account()
params = {"addr": addr, "password": password}
yield account.add_or_update_transport.future(params)
domain = os.getenv("CHATMAIL_DOMAIN")
yield account.add_transport_from_qr.future(f"dcaccount:{domain}")
assert account.is_configured()
return account