Merge pull request #5174 from matrix-org/t3chguy/fix/15100

Fix permalink local linkification to not strip via servers
pull/21833/head
Michael Telatynski 2020-09-08 15:23:38 +01:00 committed by GitHub
commit a80bcaa292
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -332,6 +332,9 @@ export function tryTransformPermalinkToLocalHref(permalink: string): string {
if (permalinkParts.roomIdOrAlias) { if (permalinkParts.roomIdOrAlias) {
const eventIdPart = permalinkParts.eventId ? `/${permalinkParts.eventId}` : ''; const eventIdPart = permalinkParts.eventId ? `/${permalinkParts.eventId}` : '';
permalink = `#/room/${permalinkParts.roomIdOrAlias}${eventIdPart}`; permalink = `#/room/${permalinkParts.roomIdOrAlias}${eventIdPart}`;
if (permalinkParts.viaServers.length > 0) {
permalink += new SpecPermalinkConstructor().encodeServerCandidates(permalinkParts.viaServers);
}
} else if (permalinkParts.groupId) { } else if (permalinkParts.groupId) {
permalink = `#/group/${permalinkParts.groupId}`; permalink = `#/group/${permalinkParts.groupId}`;
} else if (permalinkParts.userId) { } else if (permalinkParts.userId) {