Merge pull request #538 from matrix-org/dbkr/matrix_to_links

Make room alias & user ID links matrix.to links
This commit is contained in:
Richard van der Hoff 2016-11-04 11:42:49 +00:00 committed by GitHub
commit 5ac0aac65b

View File

@ -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