correctly handle MXIDs with not just-domain server names; update testdata config to include that case by default; fixes #239

This commit is contained in:
Aine
2024-12-16 12:53:42 +02:00
parent 630286a781
commit c643bdcfce
2 changed files with 6 additions and 1 deletions

View File

@@ -44,6 +44,11 @@ export function generateRandomMXID(): string {
export function returnMXID(input: string | Identifier): string {
const homeserver = localStorage.getItem("home_server");
// when homeserver is not (just) a domain name, but a domain:port or even an IPv6 address
if (input.endsWith(homeserver) && input.startsWith("@")) {
return input as string; // Already a valid MXID
}
// Check if the input already looks like a valid MXID (i.e., starts with "@" and contains ":")
if (isMXID(input)) {
return input as string; // Already a valid MXID

View File

@@ -149,7 +149,7 @@ saml2_config:
sp_config: null
user_mapping_provider:
config: null
server_name: synapse
server_name: synapse:8008
signing_key_path: /config/synapse.signing.key
spam_checker: []
sso: null