Skip to content

Commit 0349445

Browse files
authored
Check login flows only if MSC4190 is not enabled (#178)
Currently, the homeserver login flows are checked even if MSC4190 is enabled. However, the `flows` variable is unused when MSC4190 is enabled. This is an unnecessary network call, and also e.g. requires a reverse proxy soley for this purpose if bridges would otherwise directly connect to a homeserver that is delegating OIDC authentication. Closes #177.
1 parent dbf6425 commit 0349445

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

mautrix/bridge/e2ee.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -247,12 +247,13 @@ async def decrypt(self, evt: EncryptedEvent, wait_session_timeout: int = 5) -> M
247247
return decrypted
248248

249249
async def start(self) -> None:
250-
flows = await self.client.get_login_flows()
251-
if not self.msc4190 and not flows.supports_type(LoginType.APPSERVICE):
252-
self.log.critical(
253-
"Encryption enabled in config, but homeserver does not support appservice login"
254-
)
255-
sys.exit(30)
250+
if not self.msc4190:
251+
flows = await self.client.get_login_flows()
252+
if not flows.supports_type(LoginType.APPSERVICE):
253+
self.log.critical(
254+
"Encryption enabled in config, but homeserver does not support appservice login"
255+
)
256+
sys.exit(30)
256257
self.log.debug("Logging in with bridge bot user")
257258
if self.crypto_db:
258259
try:

0 commit comments

Comments
 (0)