Use body field as media caption (#1731)

* Use `body` field as media caption

As per MSC2530.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

* Add changelog

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

* Use `s` HTML tag in example

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

* Move changed-in annotation

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

---------

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
This commit is contained in:
Kévin Commaille 2024-02-26 23:15:44 +01:00 committed by GitHub
parent 9a1f0ad532
commit 4cfe2fbf8d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 140 additions and 8 deletions

View file

@ -6,8 +6,29 @@ properties:
content:
properties:
body:
description: "A description of the audio e.g. 'Bee Gees - Stayin' Alive', or some kind of content description for accessibility e.g. 'audio attachment'."
description: |-
If `filename` is not set or the value of both properties are
identical, this is the filename of the original upload. Otherwise,
this is a caption for the audio.
type: string
x-changedInMatrixVersion:
"1.10": This property can act as a caption for the audio.
format:
description: |-
The format used in the `formatted_body`. Currently only
`org.matrix.custom.html` is supported.
type: string
x-addedInMatrixVersion: "1.10"
formatted_body:
description: |-
The formatted version of the `body`, when it acts as a caption. This
is required if `format` is specified.
type: string
x-addedInMatrixVersion: "1.10"
filename:
description: The original filename of the uploaded file.
type: string
x-addedInMatrixVersion: "1.10"
info:
description: Metadata for the audio clip referred to in `url`.
properties:

View file

@ -6,8 +6,25 @@ properties:
content:
properties:
body:
description: A human-readable description of the file. This is recommended to be the filename of the original upload.
description: |-
If `filename` is not set or the value of both properties are
identical, this is the filename of the original upload. Otherwise,
this is a caption for the file.
type: string
x-changedInMatrixVersion:
"1.10": This property can act as a caption for the file.
format:
description: |-
The format used in the `formatted_body`. Currently only
`org.matrix.custom.html` is supported.
type: string
x-addedInMatrixVersion: "1.10"
formatted_body:
description: |-
The formatted version of the `body`, when it acts as a caption. This
is required if `format` is specified.
type: string
x-addedInMatrixVersion: "1.10"
filename:
description: The original filename of the uploaded file.
type: string

View file

@ -6,8 +6,29 @@ properties:
content:
properties:
body:
description: "A textual representation of the image. This could be the alt text of the image, the filename of the image, or some kind of content description for accessibility e.g. 'image attachment'."
description: |-
If `filename` is not set or the value of both properties are
identical, this is the filename of the original upload. Otherwise,
this is a caption for the image.
type: string
x-changedInMatrixVersion:
"1.10": This property can act as a caption for the image.
format:
description: |-
The format used in the `formatted_body`. Currently only
`org.matrix.custom.html` is supported.
type: string
x-addedInMatrixVersion: "1.10"
formatted_body:
description: |-
The formatted version of the `body`, when it acts as a caption. This
is required if `format` is specified.
type: string
x-addedInMatrixVersion: "1.10"
filename:
description: The original filename of the uploaded file.
type: string
x-addedInMatrixVersion: "1.10"
info:
allOf:
- $ref: core-event-schema/msgtype_infos/image_info.yaml

View file

@ -6,8 +6,29 @@ properties:
content:
properties:
body:
description: "A description of the video e.g. 'Gangnam style', or some kind of content description for accessibility e.g. 'video attachment'."
description: |-
If `filename` is not set or the value of both properties are
identical, this is the filename of the original upload. Otherwise,
this is a caption for the video.
type: string
x-changedInMatrixVersion:
"1.10": This property can act as a caption for the video.
format:
description: |-
The format used in the `formatted_body`. Currently only
`org.matrix.custom.html` is supported.
type: string
x-addedInMatrixVersion: "1.10"
formatted_body:
description: |-
The formatted version of the `body`, when it acts as a caption. This
is required if `format` is specified.
type: string
x-addedInMatrixVersion: "1.10"
filename:
description: The original filename of the uploaded file.
type: string
x-addedInMatrixVersion: "1.10"
info:
description: Metadata about the video clip referred to in `url`.
properties: