From 75b916482eb1e39bac5a63dbd5d03166eff255fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Thu, 28 Nov 2024 11:30:44 +0100 Subject: [PATCH] Apply suggested changes to rich_replies MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Kévin Commaille --- .../client-server-api/modules/rich_replies.md | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/content/client-server-api/modules/rich_replies.md b/content/client-server-api/modules/rich_replies.md index e465dd05..1cd72e1d 100644 --- a/content/client-server-api/modules/rich_replies.md +++ b/content/client-server-api/modules/rich_replies.md @@ -1,15 +1,13 @@ ### Rich replies -{{% changed-in v="1.3" %}} -{{% changed-in v="1.13" %}} - Rich replies are a special kind of [relationship](#forming-relationships-between-events) which effectively quotes the referenced event for the client to render/process how it wishes. They are normally used with [`m.room.message`](#mroommessage) events. {{% boxes/note %}} +{{% changed-in v="1.3" %}} Until v1.3 of the spec, rich replies were limited to `m.room.message` events which could represent an HTML-formatted body. As of v1.3 this is now expanded to *all* event types by dropping the requirement that an HTML-formatted body @@ -22,18 +20,20 @@ Previously, a rich reply could only reference another `m.room.message` event. {{% boxes/note %}} {{% changed-in v="1.13" %}} In previous versions of the specification, rich replies could include a fallback -format in the `body` and `formatted_body` for clients that do not support rich -replies, this is no longer the case. Clients might still want to remove this -fallback before rendering the event. +representation of the original message message in the `body` (using a prefix +sequence) and `formatted_body` (using a custom HTML element) for clients that do +not support rich replies. This is no longer the case, but clients SHOULD still +remove this fallback before rendering the event. To strip the fallback on the `body`, the client should iterate over each line of the string, removing any lines that start with the fallback -prefix ("> ", including the space, without quotes) and stopping when -a line is encountered without the prefix. This prefix is known as the -"fallback prefix sequence". +prefix sequence (`> `, including the trailing space) and stopping when +a line is encountered without the prefix. -To strip the fallback on the `formatted_body`, the client should remove -the entirety of the `mx-reply` tag. +To strip the fallback on the `formatted_body` of an `m.room.message` event with +a `format` of `org.matrix.custom.html`: if the`formatted_body` begins with an +`` start tag, the client should remove the entirety of the +`` element. {{% /boxes/note %}} Though rich replies form a relationship to another event, they do not