From 4fd18007def3fe779cb7c99a0e6be698c169ae49 Mon Sep 17 00:00:00 2001 From: Aine Date: Wed, 11 Dec 2024 18:24:08 +0200 Subject: [PATCH 1/2] Support E.164-based Matrix IDs (MSC4009) --- src/resources/users.tsx | 2 +- src/utils/mxid.ts | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/resources/users.tsx b/src/resources/users.tsx index 644385e..65c877e 100644 --- a/src/resources/users.tsx +++ b/src/resources/users.tsx @@ -189,7 +189,7 @@ export const UserList = (props: ListProps) => ( // here only local part of user_id // maxLength = 255 - "@" - ":" - storage.getItem("home_server").length // storage.getItem("home_server").length is not valid here -const validateUser = [required(), maxLength(253), regex(/^[a-z0-9._=\-/]+$/, "synapseadmin.users.invalid_user_id")]; +const validateUser = [required(), maxLength(253), regex(/^[a-z0-9._=\-\+/]+$/, "synapseadmin.users.invalid_user_id")]; const validateAddress = [required(), maxLength(255)]; diff --git a/src/utils/mxid.ts b/src/utils/mxid.ts index f5651b8..a46e266 100644 --- a/src/utils/mxid.ts +++ b/src/utils/mxid.ts @@ -41,7 +41,6 @@ export function returnMXID(input: string | Identifier): string { const homeserver = localStorage.getItem("home_server"); // Check if the input already looks like a valid MXID (i.e., starts with "@" and contains ":") - const mxidPattern = /^@[^@:]+:[^@:]+$/; if (isMXID(input)) { return input as string; // Already a valid MXID } From 92845a8640944be86cc7f6a826f7aea31998e758 Mon Sep 17 00:00:00 2001 From: Aine Date: Wed, 11 Dec 2024 18:27:41 +0200 Subject: [PATCH 2/2] update README --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index e75ed84..c184fbe 100644 --- a/README.md +++ b/README.md @@ -105,6 +105,7 @@ The following changes are already implemented: * 🤖 [User Badges](https://github.com/etkecc/synapse-admin/pull/160) * 🔑 [Allow prefilling any fields on the login form via GET params](https://github.com/etkecc/synapse-admin/pull/181) * 🖼️ [Add "Media" tab for rooms](https://github.com/etkecc/synapse-admin/pull/196) +* ➕ [Support E.164-based Matrix IDs (MSC4009)](https://github.com/etkecc/synapse-admin/pull/214) #### exclusive for [etke.cc](https://etke.cc) customers