diff --git a/src/web/routes/link.js b/src/web/routes/link.js index b46b78f..ef96ea9 100644 --- a/src/web/routes/link.js +++ b/src/web/routes/link.js @@ -17,12 +17,8 @@ const {reg} = require("../../matrix/read-registration") * @returns {string} the HS of the user, or "" if the user ID is malformed */ function getHSOfUser(user) { - domainStartIndex = user.indexOf(":"); - if (domainStartIndex >= 1) { - return user.slice(domainStartIndex + 1) - } - - return "" + /* c8 ignore next */ + return user.partition(":")[2] }