bridgev2: relay Matrix messages and reactions through Discord#227
Open
keithah wants to merge 15 commits into
Open
bridgev2: relay Matrix messages and reactions through Discord#227keithah wants to merge 15 commits into
keithah wants to merge 15 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds support for relaying Matrix reactions via a configured logged-in Discord user session when the reacting Matrix user isn’t logged into Discord.
Changes:
- Introduces
relay_reactions_fromconfig and upgrade support to select a relay Matrix user whose Discord session will be used. - Updates reaction handling to fall back to the relay user when a Matrix sender has no Discord session (and webhooks are enabled).
- Improves redaction handling to remove reactions using the appropriate user session and return clearer status reasons.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| portal.go | Adds relay reaction user lookup and uses it for reaction create/remove flows when sender isn’t logged in. |
| example-config.yaml | Documents the new relay_reactions_from configuration option. |
| config/upgrade.go | Copies bridge.relay_reactions_from during config upgrades. |
| config/bridge.go | Adds RelayReactionsFrom to the bridge config struct. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
added 6 commits
July 3, 2026 08:42
94c507f to
d89c788
Compare
added 9 commits
July 3, 2026 16:47
This reverts commit d04624a.
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.
Fix Matrix relay messages in bridgev2 Discord rooms so they are not sent as the relay account.
Relayed Matrix messages now go out through a Discord webhook for the portal. The webhook send uses the Matrix sender's display name, and when possible reuses the matching Discord ghost profile/avatar. It also handles the webhook-specific cases that normal channel sends don't cover: edits/deletes, media uploads, stale webhook recreation, safe allowed mentions, and a small reply fallback embed.
Incoming Discord echoes from the portal's own relay webhook are ignored so Matrix-originated webhook sends are not bridged back as new Discord-originated messages. This matches the old bridge invariant that relay webhook sends are tracked as Matrix-originated messages, not re-imported from the gateway echo.
Relayed Matrix reactions are wired up on the Discord connector side and use the configured relay Discord session as native Discord reactions. Discord does not support per-reaction webhook profile overrides, so reactions must not be represented as webhook messages. bridgev2 only passes relayed reactions to connectors with mautrix/go#510:
mautrix/go#510
Until that lands, the webhook message relay parts of this PR work, but relayed reactions are still blocked in mautrix-go before Discord sees them.
Tested:
go test ./pkg/... ./cmd/mautrix-discordNo changelog update included.