-
Notifications
You must be signed in to change notification settings - Fork 8
policyeval/eventhandle: Add menu to write room un/bans to policy lists #47
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
base: main
Are you sure you want to change the base?
Conversation
nexy7574
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.
a few UX woes to weed out before merge
| Stringer("user_id", userID). | ||
| Stringer("room_id", evt.RoomID). | ||
| Msg("Prompting ban propagation") | ||
| pe.propagateBan(ctx, evt) |
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.
- Being banned in several rooms can trigger this prompt multiple times, should it be deduplicated?
- The ban being undone does not short-circuit the menu which can be annoying
- Should the user be able to ban to multiple lists from one prompt (via multi-use)?
| Stringer("user_id", userID). | ||
| Stringer("room_id", evt.RoomID). | ||
| Msg("Prompting unban propagation") | ||
| pe.propagateUnban(ctx, evt) |
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.
like propagateBan, the unban being undone does not remove the prompt menus, and being unbanned from multiple rooms isn't deduplicated, which can be annoying
| if checkRules { | ||
| pe.EvaluateUser(ctx, userID, false) | ||
| } | ||
| if evt.Unsigned.PrevContent != nil && evt.Sender != pe.Bot.UserID { |
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 should probably be an option to disable these prompts altogether (since a bot might be configured to be read-only, for example). This should probably be configurable per-bot though
Sometimes it's faster to ban a problematic user in a room, and then add them to the policy list when you catch a second. This PR makes it easier to do that follow-up step by presenting relevant management rooms with a notice and prompt menu.
If the user was previously not banned, and is now banned, the bot will notify management rooms of who was banned, where, who by, and why, and prompts them to copy that ban to any policy lists that are watched and the bot has write access to.
If the user was previously banned, and is now unbanned, the bot will find all matching policies, filter for ones it can remove, provide a similar notification to above, and instead prompts them to remove any of the given policies, provided the bot is capable of removing them (i.e. again, has write access to the relevant list).
2025-12-20_02-44-01.mp4
This is similar in functionality to Draupnir's BanPropagationProtection