From a07f2d0f230ad1a1688758c59c4c0d5d7b0c38b1 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Mon, 8 Sep 2025 15:59:26 -0600 Subject: [PATCH 1/9] Part 1: Invites --- content/client-server-api/_index.md | 2 +- content/server-server-api.md | 12 ++++ data/api/server-server/invites-v1.yaml | 59 ++++++++++++++-- data/api/server-server/invites-v2.yaml | 74 +++++++++++++++----- data/event-schemas/schema/m.room.member.yaml | 6 +- 5 files changed, 130 insertions(+), 23 deletions(-) diff --git a/content/client-server-api/_index.md b/content/client-server-api/_index.md index 18a9cc27e..6726e537a 100644 --- a/content/client-server-api/_index.md +++ b/content/client-server-api/_index.md @@ -2810,7 +2810,7 @@ fresh state can be acquired from a join. Stripped state should contain some or all of the following state events, which should be represented as stripped state events when possible: -* [`m.room.create`](#mroomcreate) +* [`m.room.create`](#mroomcreate) ({{% changed-in v="1.16" %}} required on invites and knocks) * [`m.room.name`](#mroomname) * [`m.room.avatar`](#mroomavatar) * [`m.room.topic`](#mroomtopic) diff --git a/content/server-server-api.md b/content/server-server-api.md index e98d2e4c6..3e4f87f3a 100644 --- a/content/server-server-api.md +++ b/content/server-server-api.md @@ -945,6 +945,18 @@ Note that invites are used to indicate that knocks were accepted. As such, receiving servers should be prepared to manually link up a previous knock to an invite if the invite event does not directly reference the knock. +{{% boxes/note %}} +{{% added-in v="1.16" %}} `invite_room_state` MUST now have its entries formatted +according to the room's version (see [room version specification](/rooms)). However, +servers SHOULD consider their local ecosystems before returning the described +`400 M_MISSING_PARAM` error code. While migrating, servers SHOULD warn about +invites which fail the validation rather than error in room versions 1 through 11. +All invites to other room versions which fail validation SHOULD result in an error. + +The specification suggests that servers finish their migration no later than +January 2026, though servers may extend this as required to support their users. +{{% /boxes/note %}} + {{% http-api spec="server-server" api="invites-v1" %}} {{% http-api spec="server-server" api="invites-v2" %}} diff --git a/data/api/server-server/invites-v1.yaml b/data/api/server-server/invites-v1.yaml index b1771018b..82edddf37 100644 --- a/data/api/server-server/invites-v1.yaml +++ b/data/api/server-server/invites-v1.yaml @@ -71,9 +71,20 @@ paths: properties: invite_room_state: type: array + x-changedInMatrixVersion: + "1.16": | + `m.room.create` and format requirements were added. description: |- - An optional list of [stripped state events](/client-server-api/#stripped-state) - to help the receiver of the invite identify the room. + A list of state events to help the receiver of the invite identify the room. + Translated as [stripped state events](/client-server-api/#stripped-state) + over the Client-Server API. + + MUST contain the `m.room.create` event for the room. All events listed + MUST additionally be formatted according to the room version specification. + + Servers might need to apply validation to the `invite_room_state` depending + on room version. See the `400 M_MISSING_PARAM` error definition for more + information. items: $ref: ../../event-schemas/schema/core-event-schema/stripped_state.yaml example: @@ -119,13 +130,23 @@ paths: "sender": "@someone:example.org", "unsigned": { "invite_room_state": [ + { + "type": "m.room.create", + "sender": "@bob:example.org", + "state_key": "", + "content": { + "version": "12" + }, + "remaining_fields": "are formatted according to the room version specification" + }, { "type": "m.room.name", "sender": "@bob:example.org", "state_key": "", "content": { "name": "Example Room" - } + }, + "remaining_fields": "are formatted according to the room version specification" }, { "type": "m.room.join_rules", @@ -133,7 +154,8 @@ paths: "state_key": "", "content": { "join_rule": "invite" - } + }, + "remaining_fields": "are formatted according to the room version specification" } ] }, @@ -168,6 +190,35 @@ paths: "errcode": "M_FORBIDDEN", "error": "User cannot invite the target user." } + "400": + description: |- + The `M_MISSING_PARAM` error code is used to indicate one or more of + the following: + + * The `m.room.create` event is missing from `invite_room_state`. + * One or more entries in `invite_room_state` are not formatted according + to the room's version. + * One or more events fails a [signature check](/server-server-api/#validating-hashes-and-signatures-on-received-events). + * One or more events does not reside in the same room as the invite. + Note: Some room versions may require calculating the room ID for an + event rather than relying on the presence of `room_id`. + + Servers MAY apply the validation above to room versions 1 through 11, + and SHOULD apply the validation above to all other room versions. + + If `M_MISSING_PARAM` is returned and the request is associated with a + Client-Server API request, the Client-Server API request SHOULD fail + with a 5xx error rather than being passed through. + content: + application/json: + schema: + $ref: ../client-server/definitions/errors/error.yaml + examples: + response: + value: { + "errcode": "M_MISSING_PARAM", + "error": "Create event not among invite state entries." + } servers: - url: "{protocol}://{hostname}{basePath}" variables: diff --git a/data/api/server-server/invites-v2.yaml b/data/api/server-server/invites-v2.yaml index 6ac8bb3e3..743c88e83 100644 --- a/data/api/server-server/invites-v2.yaml +++ b/data/api/server-server/invites-v2.yaml @@ -72,9 +72,20 @@ paths: $ref: definitions/invite_event.yaml invite_room_state: type: array + x-changedInMatrixVersion: + "1.16": | + `m.room.create` and format requirements were added. description: |- - An optional list of [stripped state events](/client-server-api/#stripped-state) - to help the receiver of the invite identify the room. + A list of state events to help the receiver of the invite identify the room. + Translated as [stripped state events](/client-server-api/#stripped-state) + over the Client-Server API. + + MUST contain the `m.room.create` event for the room. All events listed + MUST additionally be formatted according to the room version specification. + + Servers might need to apply validation to the `invite_room_state` depending + on room version. See the `400 M_MISSING_PARAM` error definition for more + information. items: $ref: ../../event-schemas/schema/core-event-schema/stripped_state.yaml example: @@ -112,22 +123,33 @@ paths: "sender": "@someone:example.org", "unsigned": { "invite_room_state": [ - { - "type": "m.room.name", - "sender": "@bob:example.org", - "state_key": "", - "content": { - "name": "Example Room" + { + "type": "m.room.create", + "sender": "@bob:example.org", + "state_key": "", + "content": { + "version": "12" + }, + "remaining_fields": "are formatted according to the room version specification" + }, + { + "type": "m.room.name", + "sender": "@bob:example.org", + "state_key": "", + "content": { + "name": "Example Room" + }, + "remaining_fields": "are formatted according to the room version specification" + }, + { + "type": "m.room.join_rules", + "sender": "@bob:example.org", + "state_key": "", + "content": { + "join_rule": "invite" + }, + "remaining_fields": "are formatted according to the room version specification" } - }, - { - "type": "m.room.join_rules", - "sender": "@bob:example.org", - "state_key": "", - "content": { - "join_rule": "invite" - } - } ] }, "content": { @@ -151,6 +173,24 @@ paths: The error should be passed through to clients so that they may give better feedback to users. + + The `M_MISSING_PARAM` error code is used to indicate one or more of + the following: + + * The `m.room.create` event is missing from `invite_room_state`. + * One or more entries in `invite_room_state` are not formatted according + to the room's version. + * One or more events fails a [signature check](/server-server-api/#validating-hashes-and-signatures-on-received-events). + * One or more events does not reside in the same room as the invite. + Note: Some room versions may require calculating the room ID for an + event rather than relying on the presence of `room_id`. + + Servers MAY apply the validation above to room versions 1 through 11, + and SHOULD apply the validation above to all other room versions. + + If `M_MISSING_PARAM` is returned and the request is associated with a + Client-Server API request, the Client-Server API request SHOULD fail + with a 5xx error rather than being passed through. content: application/json: schema: diff --git a/data/event-schemas/schema/m.room.member.yaml b/data/event-schemas/schema/m.room.member.yaml index e768c9064..824d64d9e 100644 --- a/data/event-schemas/schema/m.room.member.yaml +++ b/data/event-schemas/schema/m.room.member.yaml @@ -137,6 +137,9 @@ properties: - type: object properties: invite_room_state: + x-changedInMatrixVersion: + "1.16": | + `m.room.create` was made a required event type for stripped state. description: |- A subset of the state of the room at the time of the invite, if `membership` is `invite`. Note that this state is informational, and SHOULD NOT be trusted; once the client has @@ -145,7 +148,8 @@ properties: they SHOULD behave properly (with possibly a degraded but not a broken experience) in the absence of any particular events here. If they are set on the room, at least the state for `m.room.avatar`, `m.room.canonical_alias`, `m.room.join_rules`, and `m.room.name` - SHOULD be included. + SHOULD be included. The `m.room.create` event MUST be included, though MAY be missing if + the server hasn't updated to support the Matrix 1.16 specification. items: $ref: "core-event-schema/stripped_state.yaml" type: array From 1692d22a8cb1a84527b8f36303c2566013043b50 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Mon, 8 Sep 2025 16:07:44 -0600 Subject: [PATCH 2/9] Part 2: Knocks --- data/api/server-server/knocks.yaml | 16 ++++++++++++++-- data/event-schemas/schema/m.room.member.yaml | 6 +++++- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/data/api/server-server/knocks.yaml b/data/api/server-server/knocks.yaml index 01bfa637f..f0cf69ad5 100644 --- a/data/api/server-server/knocks.yaml +++ b/data/api/server-server/knocks.yaml @@ -294,9 +294,21 @@ paths: type: array items: $ref: ../../event-schemas/schema/core-event-schema/stripped_state.yaml + x-changedInMatrixVersion: + "1.16": | + `m.room.create` and format requirements were added. description: |- - A list of [stripped state events](/client-server-api/#stripped-state) - to help the initiator of the knock identify the room. + A list of state events to help the initiator of the knock identify + the room. Translated as [stripped state events](/client-server-api/#stripped-state) + over the Client-Server API. + + MUST contain the `m.room.create` event for the room. All events + listed MUST additionally be formatted according to the room + version specification. + + Entries which are [improperly signed](/server-server-api/#validating-hashes-and-signatures-on-received-events) + or formatted SHOULD be removed by the server prior to supplying + them over the Client-Server API. example: $ref: ../../event-schemas/examples/knock_room_state.json required: diff --git a/data/event-schemas/schema/m.room.member.yaml b/data/event-schemas/schema/m.room.member.yaml index 824d64d9e..75510d51c 100644 --- a/data/event-schemas/schema/m.room.member.yaml +++ b/data/event-schemas/schema/m.room.member.yaml @@ -154,11 +154,15 @@ properties: $ref: "core-event-schema/stripped_state.yaml" type: array knock_room_state: + x-changedInMatrixVersion: + "1.16": | + `m.room.create` was made a required event type for stripped state. description: |- A subset of the state of the room at the time of the knock, if `membership` is `knock`. This has the same restrictions as `invite_room_state`. If they are set on the room, at least the state for `m.room.avatar`, `m.room.canonical_alias`, `m.room.join_rules`, `m.room.name`, - and `m.room.encryption` SHOULD be included. + and `m.room.encryption` SHOULD be included. The `m.room.create` event MUST be included, + though MAY be missing if the server hasn't updated to support the Matrix 1.16 specification. items: $ref: "core-event-schema/stripped_state.yaml" type: array From 8ce59031c49cc78243d33c894c94118ae9e3e26c Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Mon, 8 Sep 2025 16:21:24 -0600 Subject: [PATCH 3/9] Use correct schema and examples; Remind readers often about formats --- .../examples/stripped_state.json | 9 ++++ data/api/server-server/invites-v1.yaml | 43 ++++++------------- data/api/server-server/invites-v2.yaml | 43 ++++++------------- data/api/server-server/knocks.yaml | 15 +++++-- 4 files changed, 45 insertions(+), 65 deletions(-) create mode 100644 data/api/server-server/examples/stripped_state.json diff --git a/data/api/server-server/examples/stripped_state.json b/data/api/server-server/examples/stripped_state.json new file mode 100644 index 000000000..416d19582 --- /dev/null +++ b/data/api/server-server/examples/stripped_state.json @@ -0,0 +1,9 @@ +[ + {"$ref": "./minimal_pdu.json"}, + { + "type": "m.room.create", + "content": { + "see_room_version_spec": "The event format changes depending on the room version." + } + } +] \ No newline at end of file diff --git a/data/api/server-server/invites-v1.yaml b/data/api/server-server/invites-v1.yaml index 82edddf37..c8e411f63 100644 --- a/data/api/server-server/invites-v1.yaml +++ b/data/api/server-server/invites-v1.yaml @@ -85,10 +85,19 @@ paths: Servers might need to apply validation to the `invite_room_state` depending on room version. See the `400 M_MISSING_PARAM` error definition for more information. + + Note that events have a different format depending on the room + version - check the [room version specification](/rooms) for + precise event formats. items: - $ref: ../../event-schemas/schema/core-event-schema/stripped_state.yaml + type: object + properties: {} + description: |- + Note that events have a different format depending on the room + version - check the [room version specification](/rooms) for + precise event formats. example: - $ref: ../../event-schemas/examples/invite_room_state.json + $ref: ./examples/stripped_state.json type: object required: true responses: @@ -129,35 +138,7 @@ paths: "origin_server_ts": 1549041175876, "sender": "@someone:example.org", "unsigned": { - "invite_room_state": [ - { - "type": "m.room.create", - "sender": "@bob:example.org", - "state_key": "", - "content": { - "version": "12" - }, - "remaining_fields": "are formatted according to the room version specification" - }, - { - "type": "m.room.name", - "sender": "@bob:example.org", - "state_key": "", - "content": { - "name": "Example Room" - }, - "remaining_fields": "are formatted according to the room version specification" - }, - { - "type": "m.room.join_rules", - "sender": "@bob:example.org", - "state_key": "", - "content": { - "join_rule": "invite" - }, - "remaining_fields": "are formatted according to the room version specification" - } - ] + "invite_room_state": {"$ref": "./examples/stripped_state.json"} }, "content": { "membership": "invite" diff --git a/data/api/server-server/invites-v2.yaml b/data/api/server-server/invites-v2.yaml index 743c88e83..fd6790f55 100644 --- a/data/api/server-server/invites-v2.yaml +++ b/data/api/server-server/invites-v2.yaml @@ -86,10 +86,19 @@ paths: Servers might need to apply validation to the `invite_room_state` depending on room version. See the `400 M_MISSING_PARAM` error definition for more information. + + Note that events have a different format depending on the room + version - check the [room version specification](/rooms) for + precise event formats. items: - $ref: ../../event-schemas/schema/core-event-schema/stripped_state.yaml + type: object + properties: {} + description: |- + Note that events have a different format depending on the room + version - check the [room version specification](/rooms) for + precise event formats. example: - $ref: ../../event-schemas/examples/invite_room_state.json + $ref: ./examples/stripped_state.json required: - room_version - event @@ -122,35 +131,7 @@ paths: "origin_server_ts": 1549041175876, "sender": "@someone:example.org", "unsigned": { - "invite_room_state": [ - { - "type": "m.room.create", - "sender": "@bob:example.org", - "state_key": "", - "content": { - "version": "12" - }, - "remaining_fields": "are formatted according to the room version specification" - }, - { - "type": "m.room.name", - "sender": "@bob:example.org", - "state_key": "", - "content": { - "name": "Example Room" - }, - "remaining_fields": "are formatted according to the room version specification" - }, - { - "type": "m.room.join_rules", - "sender": "@bob:example.org", - "state_key": "", - "content": { - "join_rule": "invite" - }, - "remaining_fields": "are formatted according to the room version specification" - } - ] + "invite_room_state": {"$ref": "./examples/stripped_state.json"} }, "content": { "membership": "invite" diff --git a/data/api/server-server/knocks.yaml b/data/api/server-server/knocks.yaml index f0cf69ad5..6994f609e 100644 --- a/data/api/server-server/knocks.yaml +++ b/data/api/server-server/knocks.yaml @@ -293,7 +293,12 @@ paths: knock_room_state: type: array items: - $ref: ../../event-schemas/schema/core-event-schema/stripped_state.yaml + type: object + properties: {} + description: |- + Note that events have a different format depending on the room + version - check the [room version specification](/rooms) for + precise event formats. x-changedInMatrixVersion: "1.16": | `m.room.create` and format requirements were added. @@ -309,15 +314,19 @@ paths: Entries which are [improperly signed](/server-server-api/#validating-hashes-and-signatures-on-received-events) or formatted SHOULD be removed by the server prior to supplying them over the Client-Server API. + + Note that events have a different format depending on the room + version - check the [room version specification](/rooms) for + precise event formats. example: - $ref: ../../event-schemas/examples/knock_room_state.json + "$ref": "./examples/stripped_state.json" required: - knock_room_state examples: response: value: { "knock_room_state": { - "$ref": "../../event-schemas/examples/knock_room_state.json" + "$ref": "./examples/stripped_state.json" } } "403": From c3107d4bd8d53fb811d3f313c1f56f81045a6527 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Mon, 8 Sep 2025 16:23:52 -0600 Subject: [PATCH 4/9] changelogs --- changelogs/client_server/newsfragments/2207.feature | 1 + changelogs/server_server/newsfragments/2207.feature | 1 + 2 files changed, 2 insertions(+) create mode 100644 changelogs/client_server/newsfragments/2207.feature create mode 100644 changelogs/server_server/newsfragments/2207.feature diff --git a/changelogs/client_server/newsfragments/2207.feature b/changelogs/client_server/newsfragments/2207.feature new file mode 100644 index 000000000..74c16ddb5 --- /dev/null +++ b/changelogs/client_server/newsfragments/2207.feature @@ -0,0 +1 @@ +Invites and knocks are now expected to contain the `m.room.create` event in their stripped state entries, as per [MSC4311](https://github.com/matrix-org/matrix-spec-proposals/pull/4311). diff --git a/changelogs/server_server/newsfragments/2207.feature b/changelogs/server_server/newsfragments/2207.feature new file mode 100644 index 000000000..f4b5ad38c --- /dev/null +++ b/changelogs/server_server/newsfragments/2207.feature @@ -0,0 +1 @@ +`invite_room_state` and `knock_room_state` now have additional requirements and validation depending on the room version, as per [MSC4311](https://github.com/matrix-org/matrix-spec-proposals/pull/4311). From c231d6ff579ebab9497ef108d720906b74fcbe54 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Tue, 9 Sep 2025 11:20:07 -0600 Subject: [PATCH 5/9] Add schema warning --- content/client-server-api/_index.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/content/client-server-api/_index.md b/content/client-server-api/_index.md index 6726e537a..f95b2f470 100644 --- a/content/client-server-api/_index.md +++ b/content/client-server-api/_index.md @@ -2848,6 +2848,12 @@ events are not signed and could theoretically be modified, or outdated due to updates not being sent. {{% /boxes/warning %}} +{{% boxes/warning %}} +{{% added-in v="1.16" %}} Servers cannot pass through what they receive over +federation to clients as stripped state. Servers are expected to prune the events +into the stripped state schema below before passing the details onto clients. +{{% /boxes/warning %}} + {{% event-fields event_type="stripped_state" %}} ### Size limits From 430cbd681b4eaaa3ee7fa8f4db2ba0d42aa82330 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Tue, 9 Sep 2025 11:21:11 -0600 Subject: [PATCH 6/9] Name the objects --- data/api/server-server/invites-v1.yaml | 1 + data/api/server-server/invites-v2.yaml | 1 + 2 files changed, 2 insertions(+) diff --git a/data/api/server-server/invites-v1.yaml b/data/api/server-server/invites-v1.yaml index c8e411f63..38f8edc01 100644 --- a/data/api/server-server/invites-v1.yaml +++ b/data/api/server-server/invites-v1.yaml @@ -91,6 +91,7 @@ paths: precise event formats. items: type: object + title: PDU properties: {} description: |- Note that events have a different format depending on the room diff --git a/data/api/server-server/invites-v2.yaml b/data/api/server-server/invites-v2.yaml index fd6790f55..dc68f2e8f 100644 --- a/data/api/server-server/invites-v2.yaml +++ b/data/api/server-server/invites-v2.yaml @@ -92,6 +92,7 @@ paths: precise event formats. items: type: object + title: PDU properties: {} description: |- Note that events have a different format depending on the room From a678f0b52b7203932bb47a4aeac69763caac29ba Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Thu, 11 Sep 2025 20:48:03 -0600 Subject: [PATCH 7/9] Move changed-in and expand upon it --- content/client-server-api/_index.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/content/client-server-api/_index.md b/content/client-server-api/_index.md index f95b2f470..e39fc1b32 100644 --- a/content/client-server-api/_index.md +++ b/content/client-server-api/_index.md @@ -2810,7 +2810,7 @@ fresh state can be acquired from a join. Stripped state should contain some or all of the following state events, which should be represented as stripped state events when possible: -* [`m.room.create`](#mroomcreate) ({{% changed-in v="1.16" %}} required on invites and knocks) +* [`m.room.create`](#mroomcreate) * [`m.room.name`](#mroomname) * [`m.room.avatar`](#mroomavatar) * [`m.room.topic`](#mroomtopic) @@ -2818,6 +2818,14 @@ should be represented as stripped state events when possible: * [`m.room.canonical_alias`](#mroomcanonical_alias) * [`m.room.encryption`](#mroomencryption) +{{% changed-in v="1.16" %}} The `m.room.create` event is now **required** in +the following places: +* [`invite_state`](#get_matrixclientv3sync_response-200_invited-room) and + [`knock_state`](#get_matrixclientv3sync_response-200_knocked-room) on + [`/sync`](#get_matrixclientv3sync) responses. +* When present on [`m.room.member`](#mroommember) events, the `invite_room_state` + and `knock_room_state` under `unsigned` on the event. + {{% boxes/note %}} Clients should inspect the list of stripped state events and not assume any particular event is present. The server might include events not described From 86358e7e1749f653403dab42482e5da0dfd0ea40 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Thu, 11 Sep 2025 20:49:33 -0600 Subject: [PATCH 8/9] Rename the example --- .../{stripped_state.json => invite_or_knock_state.json} | 0 data/api/server-server/invites-v1.yaml | 4 ++-- data/api/server-server/invites-v2.yaml | 4 ++-- data/api/server-server/knocks.yaml | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) rename data/api/server-server/examples/{stripped_state.json => invite_or_knock_state.json} (100%) diff --git a/data/api/server-server/examples/stripped_state.json b/data/api/server-server/examples/invite_or_knock_state.json similarity index 100% rename from data/api/server-server/examples/stripped_state.json rename to data/api/server-server/examples/invite_or_knock_state.json diff --git a/data/api/server-server/invites-v1.yaml b/data/api/server-server/invites-v1.yaml index 38f8edc01..2f583ba26 100644 --- a/data/api/server-server/invites-v1.yaml +++ b/data/api/server-server/invites-v1.yaml @@ -98,7 +98,7 @@ paths: version - check the [room version specification](/rooms) for precise event formats. example: - $ref: ./examples/stripped_state.json + $ref: ./examples/invite_or_knock_state.json type: object required: true responses: @@ -139,7 +139,7 @@ paths: "origin_server_ts": 1549041175876, "sender": "@someone:example.org", "unsigned": { - "invite_room_state": {"$ref": "./examples/stripped_state.json"} + "invite_room_state": {"$ref": "./examples/invite_or_knock_state.json"} }, "content": { "membership": "invite" diff --git a/data/api/server-server/invites-v2.yaml b/data/api/server-server/invites-v2.yaml index dc68f2e8f..2a7e2cb9e 100644 --- a/data/api/server-server/invites-v2.yaml +++ b/data/api/server-server/invites-v2.yaml @@ -99,7 +99,7 @@ paths: version - check the [room version specification](/rooms) for precise event formats. example: - $ref: ./examples/stripped_state.json + $ref: ./examples/invite_or_knock_state.json required: - room_version - event @@ -132,7 +132,7 @@ paths: "origin_server_ts": 1549041175876, "sender": "@someone:example.org", "unsigned": { - "invite_room_state": {"$ref": "./examples/stripped_state.json"} + "invite_room_state": {"$ref": "./examples/invite_or_knock_state.json"} }, "content": { "membership": "invite" diff --git a/data/api/server-server/knocks.yaml b/data/api/server-server/knocks.yaml index 6994f609e..93fa12d5c 100644 --- a/data/api/server-server/knocks.yaml +++ b/data/api/server-server/knocks.yaml @@ -319,14 +319,14 @@ paths: version - check the [room version specification](/rooms) for precise event formats. example: - "$ref": "./examples/stripped_state.json" + "$ref": "./examples/invite_or_knock_state.json" required: - knock_room_state examples: response: value: { "knock_room_state": { - "$ref": "./examples/stripped_state.json" + "$ref": "./examples/invite_or_knock_state.json" } } "403": From f9e573fea6a8b221061dc60e28c3830198ad3c8f Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Fri, 12 Sep 2025 13:45:33 -0600 Subject: [PATCH 9/9] address review feedback --- content/client-server-api/_index.md | 2 +- data/api/server-server/invites-v1.yaml | 2 -- data/api/server-server/invites-v2.yaml | 2 -- data/api/server-server/knocks.yaml | 1 + 4 files changed, 2 insertions(+), 5 deletions(-) diff --git a/content/client-server-api/_index.md b/content/client-server-api/_index.md index e39fc1b32..fde7d305d 100644 --- a/content/client-server-api/_index.md +++ b/content/client-server-api/_index.md @@ -2823,7 +2823,7 @@ the following places: * [`invite_state`](#get_matrixclientv3sync_response-200_invited-room) and [`knock_state`](#get_matrixclientv3sync_response-200_knocked-room) on [`/sync`](#get_matrixclientv3sync) responses. -* When present on [`m.room.member`](#mroommember) events, the `invite_room_state` +* On [`m.room.member`](#mroommember) events, the `invite_room_state` and `knock_room_state` under `unsigned` on the event. {{% boxes/note %}} diff --git a/data/api/server-server/invites-v1.yaml b/data/api/server-server/invites-v1.yaml index 2f583ba26..beb44b849 100644 --- a/data/api/server-server/invites-v1.yaml +++ b/data/api/server-server/invites-v1.yaml @@ -97,8 +97,6 @@ paths: Note that events have a different format depending on the room version - check the [room version specification](/rooms) for precise event formats. - example: - $ref: ./examples/invite_or_knock_state.json type: object required: true responses: diff --git a/data/api/server-server/invites-v2.yaml b/data/api/server-server/invites-v2.yaml index 2a7e2cb9e..7b71b4725 100644 --- a/data/api/server-server/invites-v2.yaml +++ b/data/api/server-server/invites-v2.yaml @@ -98,8 +98,6 @@ paths: Note that events have a different format depending on the room version - check the [room version specification](/rooms) for precise event formats. - example: - $ref: ./examples/invite_or_knock_state.json required: - room_version - event diff --git a/data/api/server-server/knocks.yaml b/data/api/server-server/knocks.yaml index 93fa12d5c..380920857 100644 --- a/data/api/server-server/knocks.yaml +++ b/data/api/server-server/knocks.yaml @@ -294,6 +294,7 @@ paths: type: array items: type: object + title: PDU properties: {} description: |- Note that events have a different format depending on the room