-
Notifications
You must be signed in to change notification settings - Fork 27
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
Shadow-ban command #57
Conversation
Awesome! Please add the command to the checkbox list in readme.md. You could also add a little more description to what it does exactly to the commands docstring which will then land up in --help. First line is what the user sees on main command -h, the rest is shown in subcommand -h I usually steel bits and pieces from the synapse admin api docs, try to shorten. The goal is to be clear about what will happen but but not in all fancy detail like the synapse admin api docs. |
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.
Sorry for the delay. A view cosmetical changes, besides that LGTM and ready to merge :-)
synadm/api.py
Outdated
""" Shadow-ban or unban a user | ||
|
||
Args: | ||
user_id (string): The user to be baned/unbanned |
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.
Typo: banned
synadm/api.py
Outdated
|
||
Args: | ||
user_id (string): The user to be baned/unbanned | ||
unban (boolean): Unban the specified user |
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.
End "sentences" with dot.
synadm/cli/user.py
Outdated
Generally, it is more appropriate to ban or kick abusive users. | ||
""" | ||
user_ban = helper.api.user_shadow_ban(user_id, unban) | ||
helper.output(user_ban) |
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.
This API seems to always return empty dict {} when no error occured. If you want but not strictly required you could prettify that for human mode. Something like this: https://github.com/Ascurius/synadm/blob/master/synadm/cli/user.py#L127-L134
synadm/cli/user.py
Outdated
|
||
A shadow-banned user will not receive any notification, but still will be | ||
unable to contact anyone on the server. Use this as a tool of last resort since it | ||
may lead to confusing or broken behaviour for the client. |
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.
Please keep the lines 79 characters max. Don't know what editor you are using but with something vim
'ish the quickest way would be marking the lines and pressing gq
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.
Also there is a redundant space after client.
unable to contact anyone on the server. Use this as a tool of last resort since it | ||
may lead to confusing or broken behaviour for the client. | ||
|
||
Generally, it is more appropriate to ban or kick abusive users. |
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.
There is some redundant spaces.
Sorry for my late response. I modified the section you mentioned according to your requirements. Besides, I have added some additional body to the shadow-ban command for the human mode. Please let me know if anything else needs to be changed. |
No worries, all good, thanks a lot for the changes. Merged and happy synadm got a nice new feature. Many thanks! |
BTW I'd like to contact you because of something else and invite you to synadm:peek-a-boo.at |
Hi JOJ0,
I quickly implemented a first appraoch to the shadow-ban command, based on your work. Hopefully this is useful to you.
If have tried to follow your documentation and command style. However, please let me know if my implementation approach does meet your requirements regarding documentation or command structure.
Additionally I added the
env
folder for virtual python environments to the.gitignore