From 09e745bcdfad5b942f4be4af495f9287a319cb18 Mon Sep 17 00:00:00 2001 From: timedout Date: Tue, 21 Apr 2026 21:53:17 +0100 Subject: [PATCH] Specify `replaces_state` in `ClientEvent` (#2345) Signed-off-by: timedout --- .../client_server/newsfragments/2345.feature | 1 + .../definitions/client_event_without_room_id.yaml | 14 +++++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 changelogs/client_server/newsfragments/2345.feature diff --git a/changelogs/client_server/newsfragments/2345.feature b/changelogs/client_server/newsfragments/2345.feature new file mode 100644 index 00000000..b4fd7c2a --- /dev/null +++ b/changelogs/client_server/newsfragments/2345.feature @@ -0,0 +1 @@ +Specify `unsigned.replaces_state` in client-formatted events. Contributed by @nexy7574. diff --git a/data/api/client-server/definitions/client_event_without_room_id.yaml b/data/api/client-server/definitions/client_event_without_room_id.yaml index fcdf32ea..b8011ab1 100644 --- a/data/api/client-server/definitions/client_event_without_room_id.yaml +++ b/data/api/client-server/definitions/client_event_without_room_id.yaml @@ -105,9 +105,10 @@ properties: type: string prev_content: description: | - The previous `content` for this event. This field is generated - by the local homeserver, and is only returned if the event is a state event, - and the client has permission to see the previous content. + The `content` of the previous state event that was replaced by this event. + This field is generated by the local homeserver, and is only returned if + the event is a state event, and the client has permission to see the + previous event. x-changedInMatrixVersion: "1.2": | Previously, this field was specified at the top level of returned @@ -117,6 +118,13 @@ properties: this. title: EventContent type: object + replaces_state: + description: | + The event ID of the state event replaced by this event. This field is generated + by the local homeserver, and is only returned if the event is a state event. + Unlike `prev_content`, this field is included regardless of history visibility. + type: string + x-addedInMatrixVersion: "1.19" membership: description: | The room membership of the user making the request, at the time of the event.