Add per-room ignores for bot and webhook senders #88
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
cadence/out-of-your-element#88
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Some bridged Discord channels get noisy because most of the traffic is bot output: GitHub/Forgejo hooks, CI posts, log relays, dashboard pings. Once those channels are bridged, every event gets duplicated on Matrix. For users who already follow GitHub on Matrix directly (or just don't want the noise), there's no way to opt out without unbridging the channel.
I think a per-channel ignored-sender list would cover the case. PluralKit already gets a hardcoded carve-out in src/d2m/actions/speedbump.js, and the bridge skips its own webhook and ephemeral messages in src/d2m/event-dispatcher.js, but nothing user-configurable exists.
What it should do
On the Discord side, I'd want to drop a message before it's bridged based on:
message.application_id, or the application behind a webhook)message.webhook_id)On the d2m side, my guess is that this check would live near the existing webhook filter in
MESSAGE_CREATE(and the matchingMESSAGE_UPDATE/MESSAGE_DELETEhandlers).For m2d, the same idea would be filtering by sender MXID. That would help when a GitHub forge bridge or hookshot bot is posting into the same Matrix room. That looks related to the
eventSenderIsFromDiscordcheck in src/m2d/event-dispatcher.js.Scope
Per-channel/per-room is probably the right granularity, since the same bot might be welcome in some rooms and unwelcome in others. The schema already has
channel_roomcarrying per-channel state; a separateignored_sendertable keyed by(channel_id, sender_id)would avoid changing existingchannel_roomrows. Guild-wide and global ignores are nice to have but not essential.Configuration UI
I only really need one way to configure it. Any of these would work:
/bridge ignore @bot,/bridge unignore @bot,/bridge ignored), matching the existing handlers in src/discord/.Open questions
I can work on a PR once you're happy with the shape.