From 8d929add1885d23c95a06c6ef096b6074c605778 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Thu, 21 Feb 2019 15:38:17 +0100 Subject: [PATCH] delegate to class when needing a roomId permalink --- src/matrix-to.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/matrix-to.js b/src/matrix-to.js index 1c94a9e78c..b3fe10a215 100644 --- a/src/matrix-to.js +++ b/src/matrix-to.js @@ -241,8 +241,11 @@ export function makeRoomPermalink(roomId) { // Aliases are already routable, and don't need extra information. if (roomId[0] !== '!') return permalinkBase; - const serverCandidates = pickServerCandidates(roomId); - return `${permalinkBase}${encodeServerCandidates(serverCandidates)}`; + const client = MatrixClientPeg.get(); + const room = client.getRoom(roomId); + const permaLinkCreator = new RoomPermaLinkCreator(room); + permaLinkCreator.load(); + return permaLinkCreator.forRoom(); } export function makeGroupPermalink(groupId) {