From a6b155565067d1a97b0164a1132be88b9eaf6d95 Mon Sep 17 00:00:00 2001 From: Johannes Marbach Date: Fri, 23 Feb 2024 21:28:31 +0100 Subject: [PATCH] Clarify the case of HTML-only topics and transition logic (#4112) * Clarify and simplify transition logic * Clarify the case of HTML-only topics --- proposals/3765-rich-room-topics.md | 51 +++++------------------------- 1 file changed, 8 insertions(+), 43 deletions(-) diff --git a/proposals/3765-rich-room-topics.md b/proposals/3765-rich-room-topics.md index 5b423361..fa322c72 100644 --- a/proposals/3765-rich-room-topics.md +++ b/proposals/3765-rich-room-topics.md @@ -59,52 +59,17 @@ responses of `/_matrix/client/v3/publicRooms` and `/_matrix/client/v1/rooms/{roomId}/hierarchy`. The topic can be kept plain text here because this data should commonly only be displayed to users that are *not* a member of the room yet. These users will not have -the same need for rich room topics as users who are inside the room. +the same need for rich room topics as users who are inside the room. If +no plain text topic exists, home servers should return an empty topic +string from these end points. Since this will inevitably lead to bad UX, +client implementations are encouraged to always include a plain text +variant when sending `m.topic` events. ## Transition -The same transition mechanism as in [MSC1767] is proposed. In -particular, this means a new room version N is introduced. Starting from -N clients are not permitted to send `m.room.topic` events anymore and -MUST treat `m.room.topic` as an invalid event type. Instead the new -`m.topic` event type is to be used. - -Similarly, servers use the `m.topic` event type instead of -`m.room.topic` when creating rooms with a room version greater or equal -to N. - -Specific care should be taken when rooms are upgraded via -[`/rooms/{roomId}/upgrade`]. If the new room version is greater or -equal to N, an existing `m.room.topic` event in the old room - -``` json5 -{ - "type": "m.room.topic", - "state_key": "", - "content": { - "topic": "All about pizza" - }, - ... -} -``` - -should be migrated to an `m.topic` event with a single plain-text entry -in `m.text` in the new room - -``` json5 -{ - "type": "m.topic", - "state_key": "", - "content": { - "m.topic": { - "m.text": [{ - "body": "All about pizza" - }] - } - }, - ... -} -``` +As this MSC replaces `m.room.topic` for an extensible alternative, +clients and servers are expected to treat `m.room.topic` as invalid in +extensible event-supporting room versions. ## Potential issues