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:
@@ -44,6 +44,11 @@ export function generateRandomMXID(): string {
|
|||||||
export function returnMXID(input: string | Identifier): string {
|
export function returnMXID(input: string | Identifier): string {
|
||||||
const homeserver = localStorage.getItem("home_server");
|
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 ":")
|
// Check if the input already looks like a valid MXID (i.e., starts with "@" and contains ":")
|
||||||
if (isMXID(input)) {
|
if (isMXID(input)) {
|
||||||
return input as string; // Already a valid MXID
|
return input as string; // Already a valid MXID
|
||||||
|
2
testdata/synapse/homeserver.yaml
vendored
2
testdata/synapse/homeserver.yaml
vendored
@@ -149,7 +149,7 @@ saml2_config:
|
|||||||
sp_config: null
|
sp_config: null
|
||||||
user_mapping_provider:
|
user_mapping_provider:
|
||||||
config: null
|
config: null
|
||||||
server_name: synapse
|
server_name: synapse:8008
|
||||||
signing_key_path: /config/synapse.signing.key
|
signing_key_path: /config/synapse.signing.key
|
||||||
spam_checker: []
|
spam_checker: []
|
||||||
sso: null
|
sso: null
|
||||||
|
Reference in New Issue
Block a user