fix: Trim whitespace in is_admin_command #1836
No reviewers
Labels
No labels
Blocked
Bug
Changelog
Added
Changelog
Missing
Changelog
None
Cherry-picking
Database
Dependencies
Dependencies/Renovate
Difficulty
Easy
Difficulty
Hard
Difficulty
Medium
Documentation
Enhancement
Good first issue
Help wanted
Inherited
Matrix/Administration
Matrix/Appservices
Matrix/Auth
Matrix/Client
Matrix/Core
Matrix/E2EE
Matrix/Federation
Matrix/Hydra
Matrix/MSC
Matrix/Media
Matrix/T&S
Merge
Merge/Manual
Merge/Squash
Meta
Meta/CI
Meta/Packaging
Priority
Blocking
Priority
High
Priority
Low
Security
Status
Confirmed
Status
Duplicate
Status
Invalid
Status
Needs Investigation
Support
Wont fix
old/ci/cd
old/rust
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
continuwuation/continuwuity!1836
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "kitvonsnookerz/continuwuity:fix/1804-leading-whitespace"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This pull request trims whitespace from
is_admin_command, which lets users run commands even with a space before the !admin prefix.Pull request checklist:
mainbranch, and the branch is named something other thanmain.myself, if applicable. This includes ensuring code compiles.
@ -549,14 +549,16 @@ impl Service {return None;}let trimmed_body: &str = body.trim_start();Should this not be inside the
if let?Nevermind.
@ -554,3 +555,4 @@{// This is a message in the admin room// spaces are allowedI'd replace this with a comment next to
trimmed_body, saying something like// Trim leading spaces from commands48ab4f8ef31dc7b502e6The commit message should probably say "Trim whitespace" not "Trimmed whitespace", should give extra information on another line, and shouldn't end in a period.
For example, instead of the current message:
You could have:
EDIT: This has been resolved.
Issue #1804 trimmed whitespace on possible commandto fix: Trim whitespace in is_admin_command1dc7b502e6ea4034eb745c5d1d9b54ea4034eb74LGTM with my very limited rust knowledge.