From 04c27205a3057dfe38b79200f9d3ba81bb0c01fb Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 4 Nov 2016 11:38:28 +0000 Subject: [PATCH] Make room alias & user ID links matrix.to links --- src/linkify-matrix.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/linkify-matrix.js b/src/linkify-matrix.js index 3786c944a5..e7d798c9ff 100644 --- a/src/linkify-matrix.js +++ b/src/linkify-matrix.js @@ -126,6 +126,7 @@ matrixLinkify.VECTOR_URL_PATTERN = "^(?:https?:\/\/)?(?:" + ")(#.*)"; matrixLinkify.MATRIXTO_URL_PATTERN = "^(?:https?:\/\/)?(?:www\\.)?matrix\\.to/#/((#|@|!).*)"; +matrixLinkify.MATRIXTO_BASE_URL= "https://matrix.to"; matrixLinkify.options = { events: function (href, type) { @@ -148,9 +149,8 @@ matrixLinkify.options = { formatHref: function (href, type) { switch (type) { case 'roomalias': - return '#/room/' + href; case 'userid': - return '#/user/' + href; + return matrixLinkify.MATRIXTO_BASE_URL + '/#/' + href; default: var m; // FIXME: horrible duplication with HtmlUtils' transform tags