Use room alias in generated permalink for rooms
Signed-off-by: Simon Merrick <s.m3rrick@gmail.com>
This commit is contained in:
parent
bb1d52919a
commit
e92ac67152
1 changed files with 7 additions and 1 deletions
|
@ -130,7 +130,13 @@ export class RoomPermalinkCreator {
|
|||
}
|
||||
|
||||
forRoom() {
|
||||
return getPermalinkConstructor().forRoom(this._roomId, this._serverCandidates);
|
||||
try {
|
||||
// Prefer to use canonical alias for permalink if possible
|
||||
const alias = this._room.getCanonicalAlias();
|
||||
return getPermalinkConstructor().forRoom(alias, this._serverCandidates);
|
||||
} catch (error) {
|
||||
return getPermalinkConstructor().forRoom(this._roomId, this._serverCandidates);
|
||||
}
|
||||
}
|
||||
|
||||
onRoomState(event) {
|
||||
|
|
Loading…
Reference in a new issue