-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't require commands be uppercase when using !cmd
#1823
base: develop
Are you sure you want to change the base?
Changes from all commits
66f4b9a
35e10f1
15809ec
6aaa8f0
1846095
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
In `!cmd`, don't require commands be all uppercase. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -873,7 +873,7 @@ describe("Admin rooms", function() { | |
const newChannel = "#coffee"; | ||
|
||
// Expect the following commands to be sent in order | ||
const recvCommands = ["JOIN", "TOPIC", "PART", "STUPID"]; | ||
const recvCommands = ["JOIN", "TOPIC", "PART", "STUPID", "lowercase"]; | ||
|
||
let cmdIx = 0; | ||
env.ircMock._whenClient(roomMapping.server, userIdNick, "send", | ||
|
@@ -885,17 +885,15 @@ describe("Admin rooms", function() { | |
cmdIx++; | ||
}); | ||
|
||
// 5 commands should be executed | ||
// rubbishserver should not be accepted | ||
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`]; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we've lost the test for an invalid server here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. With this change "rubbishserver" is now interpreted as a command rather than as a server. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. right...we still need to interpret servers here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. They are interpreted correctly when valid, but Perhaps that could be replaced by There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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 |
||
`!cmd ${roomMapping.server} lowercase command`, | ||
]; | ||
|
||
for (let i = 0; i < commands.length; i++) { | ||
// send commands | ||
await env.mockAppService._trigger("type:m.room.message", { | ||
content: { | ||
body: commands[i], | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We still need to test lower case though?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added in 1846095