mirror of
https://github.com/matrix-org/mjolnir.git
synced 2024-10-01 01:36:06 -04:00
check for via servers before trying to join room
This commit is contained in:
parent
033d84cc70
commit
a1493113b9
@ -658,9 +658,20 @@ export class PolicyListManager {
|
||||
const permalink = Permalinks.parseUrl(roomRef);
|
||||
if (!permalink.roomIdOrAlias) return null;
|
||||
|
||||
const roomId = await this.mjolnir.client.resolveRoom(permalink.roomIdOrAlias);
|
||||
let roomId: string;
|
||||
let viaServers;
|
||||
if (permalink.roomIdOrAlias.startsWith("!")) {
|
||||
roomId = permalink.roomIdOrAlias
|
||||
viaServers = permalink.viaServers
|
||||
}
|
||||
else {
|
||||
const roomInfo = await this.mjolnir.client.lookupRoomAlias(permalink.roomIdOrAlias)
|
||||
roomId = roomInfo.roomId
|
||||
viaServers = roomInfo.residentServers
|
||||
}
|
||||
|
||||
if (!joinedRooms.includes(roomId)) {
|
||||
await this.mjolnir.client.joinRoom(roomId, permalink.viaServers);
|
||||
await this.mjolnir.client.joinRoom(roomId, viaServers);
|
||||
}
|
||||
|
||||
if (this.policyLists.find(b => b.roomId === roomId)) {
|
||||
|
Loading…
Reference in New Issue
Block a user