Skip to content

Commit 3e89f1f

Browse files
committed
Fix server URL overriding in _fresh_intent
1 parent 1dbdc3f commit 3e89f1f

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

mautrix/bridge/custom_puppet.py

+7-6
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,13 @@ def is_real_user(self) -> bool:
132132
return bool(self.custom_mxid and self.access_token)
133133

134134
def _fresh_intent(self) -> IntentAPI:
135-
_, server = self.az.intent.parse_user_id(self.custom_mxid)
136-
try:
137-
self.base_url = self.homeserver_url_map[server]
138-
except KeyError:
139-
if server == self.az.domain:
140-
self.base_url = self.az.intent.api.base_url
135+
if self.custom_mxid:
136+
_, server = self.az.intent.parse_user_id(self.custom_mxid)
137+
try:
138+
self.base_url = self.homeserver_url_map[server]
139+
except KeyError:
140+
if server == self.az.domain:
141+
self.base_url = self.az.intent.api.base_url
141142
if self.access_token == "appservice-config" and self.custom_mxid:
142143
try:
143144
secret = self.login_shared_secret_map[server]

0 commit comments

Comments
 (0)