mirror of
https://codeberg.org/keyoxide/doipjs.git
synced 2024-12-23 06:59:29 -07:00
Add matrix.to links
This commit is contained in:
parent
bd9247a566
commit
fc66f545ef
1 changed files with 10 additions and 4 deletions
|
@ -24,10 +24,16 @@ const processURI = (uri, opts) => {
|
||||||
opts = {}
|
opts = {}
|
||||||
}
|
}
|
||||||
const match = uri.match(reURI)
|
const match = uri.match(reURI)
|
||||||
let proofUrl = null
|
|
||||||
|
let profileUrl = null,
|
||||||
|
eventUrl = null,
|
||||||
|
proofUrl = null
|
||||||
|
|
||||||
if (match[2]) {
|
if (match[2]) {
|
||||||
const params = queryString.parse(match[2])
|
const params = queryString.parse(match[2])
|
||||||
if ('org.keyoxide.e' in params && 'org.keyoxide.r' in params) {
|
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(
|
proofUrl = utils.generateProxyURL(
|
||||||
'matrix',
|
'matrix',
|
||||||
[params['org.keyoxide.r'], params['org.keyoxide.e']],
|
[params['org.keyoxide.r'], params['org.keyoxide.e']],
|
||||||
|
@ -43,12 +49,12 @@ const processURI = (uri, opts) => {
|
||||||
},
|
},
|
||||||
profile: {
|
profile: {
|
||||||
display: match[1],
|
display: match[1],
|
||||||
uri: uri,
|
uri: profileUrl,
|
||||||
qr: null,
|
qr: null,
|
||||||
},
|
},
|
||||||
proof: {
|
proof: {
|
||||||
uri: proofUrl,
|
uri: eventUrl,
|
||||||
fetch: null,
|
fetch: proofUrl,
|
||||||
useProxy: false,
|
useProxy: false,
|
||||||
format: 'json',
|
format: 'json',
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue