fix(send_message): recognize XMPP JIDs as explicit targets

_parse_target_ref() has no handler for XMPP JIDs (user@server or
room@conference.server), so they fall through to the final
`return None, None, False`. This causes send_message to fail when
targeting an XMPP chat by JID, since the JID is not numeric and
doesn't match any other platform pattern.

Add an explicit check for XMPP targets containing '@', matching the
existing Matrix pattern above it.
This commit is contained in:
Quarkex 2026-05-12 17:11:50 -07:00 committed by Teknium
parent 0bc5f7b235
commit a54d4b0e46

View file

@ -355,6 +355,9 @@ def _parse_target_ref(platform_name: str, target_ref: str):
# Matrix room IDs (start with !) and user IDs (start with @) are explicit
if platform_name == "matrix" and (target_ref.startswith("!") or target_ref.startswith("@")):
return target_ref, None, True
# XMPP JIDs (user@server or room@conference.server) are explicit
if platform_name == "xmpp" and "@" in target_ref:
return target_ref, None, True
return None, None, False