mirror of
https://github.com/matrix-org/mjolnir.git
synced 2024-10-01 01:36:06 -04:00
handle case where there's no alias
This commit is contained in:
parent
de11771230
commit
914af63c37
@ -661,11 +661,17 @@ export class PolicyListManager {
|
|||||||
let roomId: string;
|
let roomId: string;
|
||||||
let viaServers: string[];
|
let viaServers: string[];
|
||||||
if (permalink.roomIdOrAlias.startsWith("!")) {
|
if (permalink.roomIdOrAlias.startsWith("!")) {
|
||||||
// get alias and then use alias to get via servers
|
// if we only have a room id, see if there's an alias we can use to get any possible
|
||||||
|
// via servers
|
||||||
const alias = await this.mjolnir.client.getPublishedAlias(permalink.roomIdOrAlias)
|
const alias = await this.mjolnir.client.getPublishedAlias(permalink.roomIdOrAlias)
|
||||||
|
if (alias) {
|
||||||
const roomInformation = await this.mjolnir.client.lookupRoomAlias(alias)
|
const roomInformation = await this.mjolnir.client.lookupRoomAlias(alias)
|
||||||
roomId = permalink.roomIdOrAlias
|
roomId = permalink.roomIdOrAlias
|
||||||
viaServers = roomInformation.residentServers
|
viaServers = roomInformation.residentServers
|
||||||
|
} else {
|
||||||
|
roomId = permalink.roomIdOrAlias
|
||||||
|
viaServers = permalink.viaServers
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
const roomInfo = await this.mjolnir.client.lookupRoomAlias(permalink.roomIdOrAlias)
|
const roomInfo = await this.mjolnir.client.lookupRoomAlias(permalink.roomIdOrAlias)
|
||||||
roomId = roomInfo.roomId
|
roomId = roomInfo.roomId
|
||||||
|
Loading…
Reference in New Issue
Block a user