From 7ed83b7dca6519bc492b295c35442d1d532a2a19 Mon Sep 17 00:00:00 2001
From: Christian Paul <christianp@matrix.org>
Date: Fri, 8 Jan 2021 12:04:00 +0100
Subject: [PATCH] Restrict people from bridging rooms after the limit has been
 reached

---
 src/matrixcommandhandler.ts | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/src/matrixcommandhandler.ts b/src/matrixcommandhandler.ts
index 536b2b7..2f20f96 100644
--- a/src/matrixcommandhandler.ts
+++ b/src/matrixcommandhandler.ts
@@ -84,11 +84,7 @@ export class MatrixCommandHandler {
                     }
                     if (await this.provisioner.RoomCountLimitReached(this.config.limits.roomCount)) {
                         log.info(`Room count limit (value: ${this.config.limits.roomCount}) reached: Rejecting command to bridge new matrix room ${event.room_id} to ${guildId}/${channelId}`);
-                        await this.bridge.botIntent.sendText(
-                            event.room_id,
-                            `This bridge has reached its room limit of ${this.config.limits.roomCount}. Unbridge another room to allow for new connections.`,
-                            "m.notice",
-                        );
+                        return `This bridge has reached its room limit of ${this.config.limits.roomCount}. Unbridge another room to allow for new connections.`;
                     }
                     try {
                         const discordResult = await this.discord.LookupRoom(guildId, channelId);
-- 
GitLab