diff --git a/mautrix/bridge/custom_puppet.py b/mautrix/bridge/custom_puppet.py index 9057877c..03034d55 100644 --- a/mautrix/bridge/custom_puppet.py +++ b/mautrix/bridge/custom_puppet.py @@ -132,8 +132,13 @@ def is_real_user(self) -> bool: return bool(self.custom_mxid and self.access_token) def _fresh_intent(self) -> IntentAPI: + _, server = self.az.intent.parse_user_id(self.custom_mxid) + try: + self.base_url = self.homeserver_url_map[server] + except KeyError: + if server == self.az.domain: + self.base_url = self.az.intent.api.base_url if self.access_token == "appservice-config" and self.custom_mxid: - _, server = self.az.intent.parse_user_id(self.custom_mxid) try: secret = self.login_shared_secret_map[server] except KeyError: