Skip to content

Commit

Permalink
If createRoomOpts === undefined, tell the homeserver that the alias r…
Browse files Browse the repository at this point in the history
…equest failed
  • Loading branch information
Christian Paul committed Aug 4, 2022
1 parent 8012315 commit 0ed6f68
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/discordas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,14 @@ async function run(): Promise<void> {
});

if (config.bridge.disablePortalBridging !== true) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
appservice.on("query.room", async (roomAlias: string, createRoom: (opts: any) => Promise<void>) => {
appservice.on("query.room", async (roomAlias: string, createRoom: (opts: unknown) => Promise<void>) => {
try {
const createRoomOpts = await roomhandler.OnAliasQuery(roomAlias);
if (!createRoomOpts) {
// This will tell the homeserver that the alias request failed.
await createRoom(false);
return;
}
await createRoom(createRoomOpts);
await roomhandler.OnAliasQueried(roomAlias, createRoomOpts.__roomId);
} catch (err) {
Expand Down

0 comments on commit 0ed6f68

Please sign in to comment.