policyeval/eventhandle: Add menu to write room un/bans to policy lists#47
Open
policyeval/eventhandle: Add menu to write room un/bans to policy lists#47
Conversation
nexy7574 commented Dec 20, 2025
Collaborator Author
nexy7574 left a comment
There was a problem hiding this comment.
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) |
Collaborator Author
There was a problem hiding this comment.
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)?
| if checkRules { | ||
| pe.EvaluateUser(ctx, userID, false) | ||
| } | ||
| if evt.Unsigned.PrevContent != nil && evt.Sender != pe.Bot.UserID { |
Collaborator Author
There was a problem hiding this comment.
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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