Skip to content

Commit b8411b5

Browse files
authored
Spec omit_members for /v2/send_join (#1393)
Per MSC3706
1 parent 9e45037 commit b8411b5

File tree

4 files changed

+120
-71
lines changed

4 files changed

+120
-71
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Extend `/_matrix/federation/v2/send_join` to allow omitting membership events, per [MSC3706](https://github.com/matrix-org/matrix-doc/pull/3706).

data/api/server-server/definitions/send_join_response.yaml

Lines changed: 0 additions & 68 deletions
This file was deleted.

data/api/server-server/joins-v1.yaml

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,46 @@ paths:
333333
- type: integer
334334
description: The value `200`.
335335
example: 200
336-
- $ref: "./definitions/send_join_response.yaml"
336+
- type: object
337+
title: Room State
338+
description: The state for the room.
339+
properties:
340+
origin:
341+
type: string
342+
description: The resident server's DNS name.
343+
auth_chain:
344+
type: array
345+
description: |-
346+
The auth chain for the entire current room state prior to the join event.
347+
348+
Note that events have a different format depending on the room version - check the
349+
[room version specification](/rooms) for precise event formats.
350+
items:
351+
type: object
352+
title: PDU
353+
description: |-
354+
The [PDUs](/server-server-api/#pdus) that make up the auth chain. The event format varies depending
355+
on the room version - check the [room version specification](/rooms) for precise event formats.
356+
schema:
357+
type: object
358+
properties: {}
359+
state:
360+
type: array
361+
description: |-
362+
The resolved current room state prior to the join event.
363+
364+
The event format varies depending on the room version - check the [room version specification](/rooms)
365+
for precise event formats.
366+
items:
367+
type: object
368+
title: PDU
369+
description: |-
370+
The [PDUs](/server-server-api/#pdus) for the fully resolved state of the room. The event format varies depending
371+
on the room version - check the [room version specification](/rooms) for precise event formats.
372+
schema:
373+
type: object
374+
properties: {}
375+
required: ["auth_chain", "state", "origin"]
337376
examples:
338377
application/json: [
339378
200,

data/api/server-server/joins-v2.yaml

Lines changed: 79 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,14 @@ paths:
6565
description: The event ID for the join event.
6666
required: true
6767
x-example: "$abc123:example.org"
68+
- in: query
69+
name: omit_members
70+
type: boolean
71+
description: |-
72+
If `true`, indicates that that calling server can accept a reduced
73+
response, in which membership events are omitted from `state` and
74+
redundant events are omitted from `auth_chain`.
75+
x-addedInMatrixVersion: "1.6"
6876
- in: body
6977
name: body
7078
type: object
@@ -186,11 +194,80 @@ paths:
186194
description: |-
187195
The join event has been accepted into the room.
188196
schema:
189-
$ref: "./definitions/send_join_response.yaml"
197+
type: object
198+
properties:
199+
origin:
200+
type: string
201+
description: The resident server's DNS name.
202+
members_omitted:
203+
type: boolean
204+
description: "`true` if `m.room.member` events have been omitted from `state`."
205+
x-addedInMatrixVersion: "1.6"
206+
auth_chain:
207+
type: array
208+
description: |-
209+
All events in the auth chain for the new join event, as well
210+
as those in the auth chains for any events returned in
211+
`state`.
212+
213+
If the `omit_members` query parameter was set to `true`, then
214+
any events that are returned in `state` may be omitted from
215+
`auth_chain`, whether or not membership events are omitted
216+
from `state`.
217+
218+
Note that events have a different format depending on the room version - check the
219+
[room version specification](/rooms) for precise event formats.
220+
items:
221+
type: object
222+
title: PDU
223+
schema:
224+
type: object
225+
properties: {}
226+
x-changedInMatrixVersion:
227+
"1.6": |-
228+
reworded to include only consider state events returned in
229+
`state`, and to allow elision of redundant events.
230+
state:
231+
type: array
232+
description: |-
233+
The resolved current room state prior to the join event.
234+
235+
If the request had `omit_members` set to `true`, events of
236+
type `m.room.member` may be omitted from the response to
237+
reduce the size of the response. If this is done,
238+
`members_omitted` must be set to `true`.
239+
items:
240+
type: object
241+
title: PDU
242+
schema:
243+
type: object
244+
properties: {}
245+
x-changedInMatrixVersion:
246+
"1.6": |-
247+
permit omission of membership events.
248+
event:
249+
type: object
250+
title: SignedMembershipEvent
251+
x-addedInMatrixVersion: "1.2"
252+
description: |-
253+
Required if the room version [supports restricted join rules](/rooms/#feature-matrix). The signed
254+
copy of the membership event sent to other servers by the resident server, including the resident
255+
server's signature.
256+
servers_in_room:
257+
type: array
258+
description: |-
259+
**Required** if `members_omitted` is true.
260+
261+
A list of the servers active in the room (ie, those with joined members) before the join.
262+
items:
263+
type: string
264+
required: ["auth_chain", "state", "origin"]
190265
examples:
191266
application/json: {
192267
"origin": "matrix.org",
193268
"auth_chain": [{"$ref": "examples/minimal_pdu.json"}],
194269
"state": [{"$ref": "examples/minimal_pdu.json"}],
195-
"event": {"$ref": "examples/pdu_v4_join_membership.json"}
270+
"event": {"$ref": "examples/pdu_v4_join_membership.json"},
271+
"members_omitted": true,
272+
"servers_in_room": ["matrix.org", "example.com"]
196273
}

0 commit comments

Comments
 (0)