Skip to content

Commit

Permalink
Properly pass vias to Element clients
Browse files Browse the repository at this point in the history
Should fix joining rooms by roomid via matrix.to.

fixes #270

Signed-off-by: Nicolas Werner <nicolas.werner@hotmail.de>
  • Loading branch information
deepbluev7 committed May 29, 2022
1 parent 0a15f14 commit 0ca4d66
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/open/clients/Element.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ export class Element {
fragmentPath = `room/${link.identifier}/${link.eventId}`;
break;
}

if ((link.kind === LinkKind.Event || link.kind === LinkKind.Room) && link.servers.length > 0) {
fragmentPath += '?' + link.servers.map(server => `via=${encodeURIComponent(server)}`).join('&');
}

const isWebPlatform = platform === Platform.DesktopWeb || platform === Platform.MobileWeb;
if (isWebPlatform || platform === Platform.iOS) {
let instanceHost = trustedWebInstances[0];
Expand Down

0 comments on commit 0ca4d66

Please sign in to comment.