mirror of
https://github.com/vector-im/element-web.git
synced 2025-08-26 17:01:49 +02:00
Fix candidate server encoding
This commit is contained in:
parent
3bc5e2beb3
commit
5b22d157a7
@ -29,6 +29,7 @@ export function makeEventPermalink(roomId, eventId) {
|
|||||||
// If the roomId isn't actually a room ID, don't try to list the servers.
|
// If the roomId isn't actually a room ID, don't try to list the servers.
|
||||||
// Aliases are already routable, and don't need extra information.
|
// Aliases are already routable, and don't need extra information.
|
||||||
if (roomId[0] !== '!') return permalinkBase;
|
if (roomId[0] !== '!') return permalinkBase;
|
||||||
|
|
||||||
const serverCandidates = pickServerCandidates(roomId);
|
const serverCandidates = pickServerCandidates(roomId);
|
||||||
return `${permalinkBase}${encodeServerCandidates(serverCandidates)}`;
|
return `${permalinkBase}${encodeServerCandidates(serverCandidates)}`;
|
||||||
}
|
}
|
||||||
@ -53,7 +54,7 @@ export function makeGroupPermalink(groupId) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function encodeServerCandidates(candidates) {
|
export function encodeServerCandidates(candidates) {
|
||||||
if (!candidates) return '';
|
if (!candidates || candidates.length === 0) return '';
|
||||||
return `?via=${candidates.map(c => encodeURIComponent(c)).join("&via=")}`;
|
return `?via=${candidates.map(c => encodeURIComponent(c)).join("&via=")}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user