matrix-appservice-irc
Don't require commands be uppercase when using `!cmd`
#1823
Open

Don't require commands be uppercase when using `!cmd` #1823

tadzik wants to merge 6 commits into develop from 1807-split/case-insensitive-admin-commands
tadzik
tadzik295 days ago

Split off from #1807, credit to @funderscore1

src/bridge/AdminRoomHandler.ts: don't require commands be uppercase
66f4b9a2
src/bridge/AdminRoomHandler.ts: fix `!help` formatting
35e10f11
tadzik spec/: fix tests to match previous changes
15809ecf
tadzik tadzik requested a review 295 days ago
tadzik changelog
6aaa8f03
Half-Shot
Half-Shot approved these changes on 2024-09-18
Half-Shot288 days ago

Seems reasonable aside from a lost test?

spec/integ/admin-rooms.spec.js
892891 `!cmd ${roomMapping.server} TOPIC ${newChannel} :some new fancy topic`,
893892 `!cmd ${roomMapping.server} PART ${newChannel}`,
894 `!cmd ${roomMapping.server} STUPID COMMANDS`,
895
`!cmd rubbishserver SOME COMMAND`];
Half-Shot288 days ago

we've lost the test for an invalid server here?

funderscore1288 days ago

With this change "rubbishserver" is now interpreted as a command rather than as a server.

Half-Shot288 days ago

right...we still need to interpret servers here.

funderscore1288 days ago

They are interpreted correctly when valid, but rubbishserver matches the new regex.

Perhaps that could be replaced by rubbish^server! or something?

tadzik217 days ago

Or we could have two servers configured to ensure that the first string needs to match a server.

I think it's okay to let this one slide though. We're not breaking anything anything except wrong usage of commands, and I don't think there's much of a risk of a server being called quit or something that could land a user in (minor) trouble.

Half-Shot
Half-Shot commented on 2024-09-18
Half-Shot288 days ago

oh and

spec/integ/admin-rooms.spec.js
887887
888 // 5 commands should be executed
889 // rubbishserver should not be accepted
888 // 4 commands should be executed
890889 const commands = [
891890
`!cmd ${roomMapping.server} JOIN ${newChannel}`,
Half-Shot288 days ago

We still need to test lower case though?

tadzik217 days ago

Added in 1846095

tadzik Test lowercase command handling
18460950
tadzik Merge branch 'develop' into 1807-split/case-insensitive-admin-commands
aebab8a8

Login to write a write a comment.

Login via GitHub

Assignees
No one assigned
Labels
Milestone