Repository navigation
Conversation
Bridges can mark a message as forwarded with a structured field instead of writing the notice into the body. The bridgev2 Matrix connector adds the existing "↷ Forwarded" text and HTML fallback at send time and sets has_fallback, so clients that understand the field can strip it and get the original caption back.
Member
|
Forwarded messages should be planned properly (probably based on MSC4553) rather than hacked in for one bridge |
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.
mautrix/whatsapp marks forwarded messages by writing
↷ Forwardedinto the message itself: media without a caption gets it as the body (the filename moves tofilename), and text or captioned media gets↷ Forwarded\n\nprepended plus<p data-mx-forwarded-notice>in the HTML. Clients can't tell that apart from a real caption, so forwarded photos render as captioned images and a forwarded album doesn't group into a gallery.This adds a structured field following the per-message profile pattern:
MessageEventContent.BeeperForwarded(com.beeper.forwarded, withhas_fallback).AddForwardedFallbackproduces exactly the text/HTML the WhatsApp connector writes today.RemoveForwardedFallbackundoes it whenhas_fallbackis set, restoring the body to the filename for uncaptioned media.bridgev2/matrixASIntent.SendMessageadds the forwarded fallback before the per-message profile fallback, so the wire format for existing clients is unchanged. Clients that understand the field remove the profile fallback first, then the forwarded one.Connectors that set the field and don't run through
bridgev2/matrix(Beeper's on-device bridges) send the original caption with no fallback.Follow-ups: mautrix/whatsapp sets the field instead of editing the body. Telegram's "Forwarded from X" header could use the same field later, but that needs source fields and isn't covered here.
Tag
@indentto continue the conversation here.