Make "share this room" use aliases if possible

Signed-off-by: Aaron Raimist <aaron@raim.ist>
pull/21833/head
Aaron Raimist 2021-05-29 01:38:41 -05:00
parent 53ebf3b8e3
commit ccdd2311f4
No known key found for this signature in database
GPG Key ID: 37419210002890EF
1 changed files with 3 additions and 3 deletions

View File

@ -293,16 +293,16 @@ export function makeRoomPermalink(roomId: string): string {
// 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.
if (roomId[0] !== '!') return getPermalinkConstructor().forRoom(roomId, []);
if (roomId[0] !== '!') return getPermalinkConstructor().forShareableRoom(roomId, []);
const client = MatrixClientPeg.get();
const room = client.getRoom(roomId);
if (!room) {
return getPermalinkConstructor().forRoom(roomId, []);
return getPermalinkConstructor().forShareableRoom(roomId, []);
}
const permalinkCreator = new RoomPermalinkCreator(room);
permalinkCreator.load();
return permalinkCreator.forRoom();
return permalinkCreator.forShareableRoom();
}
export function makeGroupPermalink(groupId: string): string {