@ -40,12 +40,12 @@ And aggregating event, to send after all message attachments:
"body": "Here is my photos and videos from yesterday event",
"m.relates_to": [
{
"rel_type": "m.attachment",
"event_id": "$id_of_previosly_send_media_event_1"
"rel_type": "m.attachment",
"event_id": "$id_of_previosly_send_media_event_1"
},
{
"rel_type": "m.attachment",
"event_id": "$id_of_previosly_send_media_event_2"
"rel_type": "m.attachment",
"event_id": "$id_of_previosly_send_media_event_2"
}
]
}
@ -55,16 +55,16 @@ For edits of "message with attachments" we can reuse same "m.relates_to" array v
```json
"m.relates_to": [
{
"rel_type": "m.attachment",
"event_id": "$id_of_previosly_send_media_event_1"
"rel_type": "m.attachment",
"event_id": "$id_of_previosly_send_media_event_1"
},
{
"rel_type": "m.replace",
"event_id": "$id_of_original event"
"rel_type": "m.replace",
"event_id": "$id_of_original event"
},
{
"rel_type": "m.attachment",
"event_id": "$id_of_previosly_send_media_event_2"
"rel_type": "m.attachment",
"event_id": "$id_of_previosly_send_media_event_2"
}
]
```
@ -183,6 +183,28 @@ This way will give less "spam" for room, because when user sends message with 20
4. There are also [MSC2530: Body field as media caption](https://github.com/matrix-org/matrix-doc/pull/2530) but it describes only text description for one media, not several media items, and very similar [MSC2529: Proposal to use existing events as captions for images](https://github.com/matrix-org/matrix-doc/pull/2529) that implement same thing, but via separate event. But if we send several medias grouped as gallery, usually one text description is enough.
5. Other alternative can be posting `m.message` event at first, and link all attachments to it later via `m.relates_to` field, something like this:
But this way will give harder way to render of main message event, because Matrix clients must be search all attached events manually in timeline.
## Future considerations
In future, we may extend the `m.attachments` field with new types to allow attaching external URL as cards with URL preview, oEmbed entities, and other events (for example, to forward the list of several events to other room with the user comment).