From fc66f545efffa36cc5f6a3871552b5c3ad025a97 Mon Sep 17 00:00:00 2001 From: Yarmo Mackenbach Date: Sat, 6 Mar 2021 23:32:10 +0100 Subject: [PATCH] Add matrix.to links --- src/serviceproviders/matrix.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/serviceproviders/matrix.js b/src/serviceproviders/matrix.js index aa21037..eff76bb 100644 --- a/src/serviceproviders/matrix.js +++ b/src/serviceproviders/matrix.js @@ -24,10 +24,16 @@ const processURI = (uri, opts) => { opts = {} } const match = uri.match(reURI) - let proofUrl = null + + let profileUrl = null, + eventUrl = null, + proofUrl = null + if (match[2]) { const params = queryString.parse(match[2]) if ('org.keyoxide.e' in params && 'org.keyoxide.r' in params) { + profileUrl = `https://matrix.to/#/${match[1]}` + eventUrl = `https://matrix.to/#/${params['org.keyoxide.r']}/${params['org.keyoxide.e']}` proofUrl = utils.generateProxyURL( 'matrix', [params['org.keyoxide.r'], params['org.keyoxide.e']], @@ -43,12 +49,12 @@ const processURI = (uri, opts) => { }, profile: { display: match[1], - uri: uri, + uri: profileUrl, qr: null, }, proof: { - uri: proofUrl, - fetch: null, + uri: eventUrl, + fetch: proofUrl, useProxy: false, format: 'json', },