1
0
Fork 0
forked from Mirrors/gomuks

web/util: decode fragment parts in matrix URIs

This commit is contained in:
Tulir Asokan 2024-12-06 16:10:24 +02:00
parent 2c7ad651e4
commit 544bd17a1d

View file

@ -63,13 +63,13 @@ export function parseMatrixURI(uri: unknown): ParsedMatrixURI | undefined {
params: parsed.searchParams, params: parsed.searchParams,
} }
if (type === "u") { if (type === "u") {
output.identifier = `@${ident1}` output.identifier = `@${decodeURIComponent(ident1)}`
} else if (type === "r") { } else if (type === "r") {
output.identifier = `#${ident1}` output.identifier = `#${decodeURIComponent(ident1)}`
} else if (type === "roomid") { } else if (type === "roomid") {
output.identifier = `!${ident1}` output.identifier = `!${decodeURIComponent(ident1)}`
if (subtype === "e") { if (subtype === "e") {
output.eventID = `$${ident2}` output.eventID = `$${decodeURIComponent(ident2)}`
} }
} else { } else {
return return