From f40d175bf16140d1a37707e7909ef06efb3e31f3 Mon Sep 17 00:00:00 2001 From: Ben Parsons Date: Thu, 7 May 2020 15:50:44 +0100 Subject: [PATCH 1/3] proposal to use existing events as captions for images --- proposals/2529-text-messages-as-captions.md | 37 +++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 proposals/2529-text-messages-as-captions.md diff --git a/proposals/2529-text-messages-as-captions.md b/proposals/2529-text-messages-as-captions.md new file mode 100644 index 00000000000..df76e325c5f --- /dev/null +++ b/proposals/2529-text-messages-as-captions.md @@ -0,0 +1,37 @@ +# Use existing m.room.message/m.text events as captions for images + +## Background + +There is a demand to be able to apply a text caption to an image, as is possible in other chat platforms. In Matrix this is not possible, so people will generally send two events: one `m.image`, then a `m.text` event immediately afterward to simulate a caption. + +Better would be to able to explicitly mark an event as a caption. + +## Proposal + +Allow an optional `m.relates_to` field in the `content` field of a text message event. + +Example: + +``` +... + "content": { + "body": "Caption text", + "msgtype": "m.text", + "m.relates_to": { + "event_id": "$(some image event)", + "rel_type": "m.caption" + } + }, +``` + +If a client recognises the `rel_type`, they can render the caption with the image rather than as a separate message in the timeline. + +The benefit of this is that if a client doesn't support or recognise the `m.caption`, it can ignore the relation and just render the message inline. + +This would not require aggregation from the server since there will always be a need to send the event separately anyway. + +## Potential issues + +* Not sure how this relates to the broader questions discussed in MSC1849 +* This is catering to a narrow use-case requirement. There may be a more general solution available +* Would MSC1767 (extensible events) obsolete this? From 720b76fe62135a964e953a0ce059081e8a1afa56 Mon Sep 17 00:00:00 2001 From: Ben Parsons Date: Thu, 7 May 2020 16:42:05 +0100 Subject: [PATCH 2/3] line-wrapping --- proposals/2529-text-messages-as-captions.md | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/proposals/2529-text-messages-as-captions.md b/proposals/2529-text-messages-as-captions.md index df76e325c5f..7c9035697df 100644 --- a/proposals/2529-text-messages-as-captions.md +++ b/proposals/2529-text-messages-as-captions.md @@ -2,13 +2,17 @@ ## Background -There is a demand to be able to apply a text caption to an image, as is possible in other chat platforms. In Matrix this is not possible, so people will generally send two events: one `m.image`, then a `m.text` event immediately afterward to simulate a caption. +There is a demand to be able to apply a text caption to an image, as is +possible in other chat platforms. In Matrix this is not possible, so people +will generally send two events: one `m.image`, then a `m.text` event +immediately afterward to simulate a caption. Better would be to able to explicitly mark an event as a caption. ## Proposal -Allow an optional `m.relates_to` field in the `content` field of a text message event. +Allow an optional `m.relates_to` field in the `content` field of a text message +event. Example: @@ -24,11 +28,14 @@ Example: }, ``` -If a client recognises the `rel_type`, they can render the caption with the image rather than as a separate message in the timeline. +If a client recognises the `rel_type`, they can render the caption with the +image rather than as a separate message in the timeline. -The benefit of this is that if a client doesn't support or recognise the `m.caption`, it can ignore the relation and just render the message inline. +The benefit of this is that if a client doesn't support or recognise the +`m.caption`, it can ignore the relation and just render the message inline. -This would not require aggregation from the server since there will always be a need to send the event separately anyway. +This would not require aggregation from the server since there will always be a +need to send the event separately anyway. ## Potential issues From 531afe885f8338825044f2927c4f3869a9af7e4a Mon Sep 17 00:00:00 2001 From: Ben Parsons Date: Thu, 7 May 2020 17:06:25 +0100 Subject: [PATCH 3/3] there are different types of space --- proposals/2529-text-messages-as-captions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proposals/2529-text-messages-as-captions.md b/proposals/2529-text-messages-as-captions.md index 7c9035697df..e46740b779a 100644 --- a/proposals/2529-text-messages-as-captions.md +++ b/proposals/2529-text-messages-as-captions.md @@ -9,7 +9,7 @@ immediately afterward to simulate a caption. Better would be to able to explicitly mark an event as a caption. -## Proposal +## Proposal Allow an optional `m.relates_to` field in the `content` field of a text message event.