From 66f4b9a24893ffafa0a2a97ff84f1c19fc730faf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ferass=20El=C2=A0Hafidi?= Date: Fri, 14 Jun 2024 22:04:25 +0200 Subject: [PATCH 1/4] src/bridge/AdminRoomHandler.ts: don't require commands be uppercase when using `!cmd` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit IRC commands can be lowercase. Signed-off-by: Ferass El Hafidi --- src/bridge/AdminRoomHandler.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bridge/AdminRoomHandler.ts b/src/bridge/AdminRoomHandler.ts index ad25697b4..37d84a105 100644 --- a/src/bridge/AdminRoomHandler.ts +++ b/src/bridge/AdminRoomHandler.ts @@ -428,7 +428,7 @@ export class AdminRoomHandler { const keyword = args[0]; // keyword could be a failed server or a malformed command - if (!keyword.match(/^[A-Z]+$/)) { + if (!keyword.match(/^[A-Za-z]+$/)) { // if not a domain OR is only word (which implies command) if (!keyword.match(/^[a-z0-9:\.-]+$/) || args.length === 1) { throw new Error(`Malformed command: ${keyword}`); From 35e10f119b8ea97198c85aab80b5906627affd86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ferass=20El=C2=A0Hafidi?= Date: Fri, 14 Jun 2024 22:16:10 +0200 Subject: [PATCH 2/4] src/bridge/AdminRoomHandler.ts: fix `!help` formatting MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ferass El Hafidi --- src/bridge/AdminRoomHandler.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bridge/AdminRoomHandler.ts b/src/bridge/AdminRoomHandler.ts index 37d84a105..82c3ecc13 100644 --- a/src/bridge/AdminRoomHandler.ts +++ b/src/bridge/AdminRoomHandler.ts @@ -89,12 +89,12 @@ const COMMANDS: {[command: string]: Command|Heading} = { 'Actions': { heading: true }, "cmd": { example: `!cmd [irc.example.net] COMMAND [arg0 [arg1 [...]]]`, - summary: "Issue a raw IRC command. These will not produce a reply." + + summary: "Issue a raw IRC command. These will not produce a reply. " + "(Note that the command must be all uppercase.)", }, "feature": { example: `!feature feature-name [true/false/default]`, - summary: `Enable, disable or default a feature's status for your account.` + + summary: `Enable, disable or default a feature's status for your account. ` + `Will display the current feature status if true/false/default not given.`, }, "join": { From 15809ecf6a0cdf3f18a1b2dc284e5fb0775a3222 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tadeusz=20=E2=80=9Etadzik=E2=80=9D=20So=C5=9Bnierz?= Date: Thu, 12 Sep 2024 13:13:18 +0200 Subject: [PATCH 3/4] spec/: fix tests to match previous changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ferass El Hafidi --- spec/integ/admin-rooms.spec.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/spec/integ/admin-rooms.spec.js b/spec/integ/admin-rooms.spec.js index 1f2124c08..c89f21732 100644 --- a/spec/integ/admin-rooms.spec.js +++ b/spec/integ/admin-rooms.spec.js @@ -885,14 +885,12 @@ describe("Admin rooms", function() { cmdIx++; }); - // 5 commands should be executed - // rubbishserver should not be accepted + // 4 commands should be executed const commands = [ `!cmd ${roomMapping.server} JOIN ${newChannel}`, `!cmd ${roomMapping.server} TOPIC ${newChannel} :some new fancy topic`, `!cmd ${roomMapping.server} PART ${newChannel}`, - `!cmd ${roomMapping.server} STUPID COMMANDS`, - `!cmd rubbishserver SOME COMMAND`]; + `!cmd ${roomMapping.server} STUPID COMMANDS`]; for (let i = 0; i < commands.length; i++) { // send commands From 6aaa8f03c2d6de940f582236c083163e3884c707 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tadeusz=20=E2=80=9Etadzik=E2=80=9D=20So=C5=9Bnierz?= Date: Thu, 12 Sep 2024 13:14:50 +0200 Subject: [PATCH 4/4] changelog --- changelog.d/1823.feature | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/1823.feature diff --git a/changelog.d/1823.feature b/changelog.d/1823.feature new file mode 100644 index 000000000..1a94db5d6 --- /dev/null +++ b/changelog.d/1823.feature @@ -0,0 +1 @@ +In `!cmd`, don't require commands be all uppercase.