diff --git a/src/models/PolicyList.ts b/src/models/PolicyList.ts index af0981a..6a82e78 100644 --- a/src/models/PolicyList.ts +++ b/src/models/PolicyList.ts @@ -661,11 +661,17 @@ export class PolicyListManager { let roomId: string; let viaServers: string[]; 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 roomInformation = await this.mjolnir.client.lookupRoomAlias(alias) - roomId = permalink.roomIdOrAlias - viaServers = roomInformation.residentServers + if (alias) { + const roomInformation = await this.mjolnir.client.lookupRoomAlias(alias) + roomId = permalink.roomIdOrAlias + viaServers = roomInformation.residentServers + } else { + roomId = permalink.roomIdOrAlias + viaServers = permalink.viaServers + } } else { const roomInfo = await this.mjolnir.client.lookupRoomAlias(permalink.roomIdOrAlias) roomId = roomInfo.roomId