-
-
Notifications
You must be signed in to change notification settings - Fork 29
Automatically dehoist & undehoist on mute & unmute #313
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
Conversation
| // can be safely removed internally. | ||
| await Program.redis.HashDeleteAsync("mutes", targetUser.Id); | ||
|
|
||
| // attempt to undehoist member if they should not otherwise be hoisted |
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 doesn't handle manual dehoists, like:
- dehoist user
- mute user
- unmute user
and it undehoisted them, but it shouldn't do that if they were manually dehoisted before the mute. This might require storing extra data to track manual dehoists?
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 might require storing extra data to track manual dehoists?
This is a bit tricky—storing a flag on !dehoist is easy, but then we don't have an !undehoist and the way to actually undehoist is to just change a member's nickname & remove the dehoist character
I suppose we would want to check their nickname on Member Update, and unset the flag if their nickname previously had the dehoist character (so, if the flag was set) but no longer does?
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.
Thanks for adding permadehoist tracking, that's a good start.
I suppose we would want to check their nickname on Member Update, and unset the flag if their nickname previously had the dehoist character (so, if the flag was set) but no longer does?
Yeah if they change from a name with the character to one without the character we can remove it.
If this is impossible or too hard I'm happy to leave as-is and say that anyone who cares about this should use permadehoist instead.
Erisa
left a comment
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.
With permadehoist, the remaining review conversation is optional, merge with or without depending how hard it is.
Closes #90
Automatically dehoists members when they are muted, and undehoists them when they are unmuted (only if they would not be immediately auto-dehoisted again / if their name does not start with a hoisting character after the dehoist character). When undehoisting, the member's nickname is just cleared if it is the same as their global display name (or username if their display name is not set).
Logged to the Audit Log with reasons
[Automatic dehoist on mute]and[Automatic undehoist on unmute].