Skip to content

WIP: policyeval/eventhandle: Add menu to write room un/bans to policy lists#47

Draft
timedoutuk wants to merge 3 commits into
mainfrom
nexy7574/propagation-prompt
Draft

WIP: policyeval/eventhandle: Add menu to write room un/bans to policy lists#47
timedoutuk wants to merge 3 commits into
mainfrom
nexy7574/propagation-prompt

Conversation

@timedoutuk

@timedoutuk timedoutuk commented Dec 20, 2025

Copy link
Copy Markdown
Collaborator

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

@timedoutuk timedoutuk left a comment

Copy link
Copy Markdown
Collaborator Author

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

Comment thread policyeval/eventhandle.go
Stringer("user_id", userID).
Stringer("room_id", evt.RoomID).
Msg("Prompting ban propagation")
pe.propagateBan(ctx, evt)

@timedoutuk timedoutuk Dec 20, 2025

Copy link
Copy Markdown
Collaborator Author

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)?

Comment thread policyeval/eventhandle.go
Comment thread policyeval/eventhandle.go
if checkRules {
pe.EvaluateUser(ctx, userID, false)
}
if evt.Unsigned.PrevContent != nil && evt.Sender != pe.Bot.UserID {

Copy link
Copy Markdown
Collaborator Author

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

@timedoutuk timedoutuk changed the title policyeval/eventhandle: Add menu to write room un/bans to policy lists WIP: policyeval/eventhandle: Add menu to write room un/bans to policy lists Mar 24, 2026
@timedoutuk
timedoutuk marked this pull request as draft March 24, 2026 21:21
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.

1 participant