Skip to content
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

Remove --true flag for unban command #653

Merged
merged 2 commits into from
Jan 7, 2025

Conversation

nexy7574
Copy link
Contributor

@nexy7574 nexy7574 commented Jan 6, 2025

Closes #648 by making --true the default behaviour.

Copy link
Member

@Gnuxie Gnuxie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, just one tiny change for this one

Comment on lines 135 to 141
keywords: {
keywordDescriptions: {
true: {
isFlag: true,
},
},
},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably keep this, just in case someone does provide it and they get confused why draupnir now spits their command back out (draupnir will give them an error if they provide an unknown option).

Just add a comment above keywords: saying

// This is a legacy option to unban the user from all rooms that we now ignore just so providing the option doesn't cause an error.

summary:
"Removes an entity from a policy list. If the entity is a glob, then the flag --true must be provided to unban users matching the glob from all protected rooms.",
summary: "Removes an entity from a policy list.",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, now here this is problematic, we've not realised that --true had dual purposes:

  • The first is wholly terrible, which was to confirm that you wanted to unban users from all rooms
  • The second isn't so bad, which is to make sure you understand you are using a glob. Similar to the kick command's glob option.

We probably do want that glob option to be there and we can pretty much copy what the kick command does there. What do you think?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok nah, that's wrong. Because the whole point of accepting globs is to remove policy rules, not unban users matching globs.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The message that the command sends to the management room afterwards unbans users matching a glob only because that's what it needs to do when a glob policy rule is removed

@Gnuxie Gnuxie merged commit 5d11114 into the-draupnir-project:main Jan 7, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove unban --true cos it's terrible and confuses new users, make it the default behaviour.
2 participants