-
Notifications
You must be signed in to change notification settings - Fork 411
MSC2530: Body field as media caption #2530
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
a72bf5e
Proposal to use body field as media caption
tulir 6691780
Add paragraph about relation-based captions being difficult for bridges
tulir 2cf7abb
Clarify how to treat body when filename is not present
tulir a7047f8
Refactor proposal text
tulir aebe61a
Fix heading size
tulir 76d5b54
Add problem statement
tulir 675198d
Add links to and quotes from current spec
tulir 5b3d74e
Adjust wording and quote m.audio body spec
tulir cca27fd
Clarify that m.location and m.sticker are out of scope for this proposal
tulir ec23050
Add examples and summary of changes
tulir cbcd0dc
Fix JSON syntax in example
tulir File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Body field as media caption | ||
|
||
This is an alternative to [MSC2529](https://github.com/matrix-org/matrix-doc/pull/2529). | ||
|
||
## Proposal | ||
|
||
This proposal defines a new field `filename` and allows the `format` and | ||
`formatted_body` fields (from `m.text`) for all media msgtypes (`m.image`, | ||
`m.audio`, `m.video`, `m.file`). | ||
|
||
If the `filename` field is present in a media message, clients should treat | ||
`body` as a caption instead of a file name. The `formatted_body` field should | ||
tulir marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
also be supported and work the same way as they do in `m.text` messages. | ||
|
||
## Comparison to MSC2529 | ||
|
||
While this approach isn't backwards-compatible like MSC2529, it's simpler to | ||
implement as it doesn't require handling relations. | ||
|
||
Implementing relation-based captions would be especially difficult for bridges. | ||
It would require either waiting a predefined amount of time for the caption to | ||
come through, or editing the message on the target platform (if edits are | ||
supported). | ||
|
||
Additionally, some clients already render the body (as a file name), so the | ||
new-style caption would already be visible in those cases. | ||
|
||
The format proposed by MSC2529 would also make it technically possible to use | ||
other message types without changing the format of the events, which is not | ||
possible with this proposal. | ||
|
||
## Potential issues | ||
|
||
The spec for `m.file` already defines a `filename` field, but the spec also | ||
says `body` should contain the file name. This means old `m.file` messages | ||
could be misinterpreted to contain a caption, even though it's just the file | ||
name. To avoid this problem, we could require that `body` and `filename` must | ||
be different for `body` to be interpreted as a caption. | ||
|
||
|
||
Like MSC2529, this would be obsoleted by [extensible events](https://github.com/matrix-org/matrix-doc/pull/1767). | ||
In my opinion, unless extensible events are planned to be pushed through in the | ||
near future, we shouldn't block basic features like captions on extensible | ||
events hopefully eventually happening. |
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.
Uh oh!
There was an error while loading. Please reload this page.