Skip to content

Commit 7c833d5

Browse files
committed
Add room_types and room_type to /publicRooms
MSC: matrix-org/matrix-spec-proposals#3827 Incorporates matrix-org/matrix-spec-proposals#3858
1 parent b36d4ef commit 7c833d5

File tree

6 files changed

+39
-8
lines changed

6 files changed

+39
-8
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add `room_types` filter and `room_type` response to `/publicRooms`, as per [MSC3827](https://github.com/matrix-org/matrix-spec-proposals/pull/3827).

data/api/client-server/definitions/public_rooms_chunk.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@ properties:
5757
The room's join rule. When not present, the room is assumed to
5858
be `public`.
5959
example: "public"
60+
room_type:
61+
type: string
62+
x-addedInMatrixVersion: "1.4"
63+
description: |-
64+
The `type` of room (from [`m.room.create`](/client-server-api/#mroomcreate)), if any.
6065
required:
6166
- room_id
6267
- num_joined_members

data/api/client-server/definitions/public_rooms_response.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ example: {
6262
"room_id": "!ol19s:bleecker.street",
6363
"topic": "Tasty tasty cheese",
6464
"world_readable": true,
65-
"join_rule": "public"
65+
"join_rule": "public",
66+
"room_type": "m.space"
6667
}
6768
],
6869
"next_batch": "p190q",

data/api/client-server/list_public_rooms.yaml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,18 @@ paths:
198198
generic_search_term:
199199
type: string
200200
description: |-
201-
A string to search for in the room metadata, e.g. name,
202-
topic, canonical alias etc. (Optional).
201+
An optional string to search for in the room metadata, e.g. name,
202+
topic, canonical alias, etc.
203+
room_types:
204+
type: array
205+
x-addedInMatrixVersion: "1.4"
206+
items:
207+
type: string
208+
description: |-
209+
An optional list of [room types](/client-server-api/#types) to search
210+
for. To include rooms without a room type, specify `null` within this
211+
list. When not specified, all applicable rooms (regardless of type)
212+
are returned.
203213
include_all_networks:
204214
type: boolean
205215
description: |-
@@ -215,7 +225,8 @@ paths:
215225
example: {
216226
"limit": 10,
217227
"filter": {
218-
"generic_search_term": "foo"
228+
"generic_search_term": "foo",
229+
"room_types": [null, "m.space"]
219230
},
220231
"include_all_networks": false,
221232
"third_party_instance_id": "irc"

data/api/client-server/space_hierarchy.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ paths:
129129
- type: object
130130
title: ChildRoomsChunk
131131
properties:
132+
# Override x-addedInMatrixVersion for room_type (this endpoint had it first)
132133
room_type:
133134
type: string
134135
description: |-

data/api/server-server/public_rooms.yaml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,18 @@ paths:
110110
generic_search_term:
111111
type: string
112112
description: |-
113-
A string to search for in the room metadata, e.g. name,
114-
topic, canonical alias etc. (Optional).
113+
An optional string to search for in the room metadata, e.g. name,
114+
topic, canonical alias, etc.
115+
room_types:
116+
type: array
117+
x-addedInMatrixVersion: "1.4"
118+
items:
119+
type: string
120+
description: |-
121+
An optional list of [room types](/client-server-api/#types) to search
122+
for. To include rooms without a room type, specify `null` within this
123+
list. When not specified, all applicable rooms (regardless of type)
124+
are returned.
115125
include_all_networks:
116126
type: boolean
117127
description: |-
@@ -127,7 +137,8 @@ paths:
127137
example: {
128138
"limit": 10,
129139
"filter": {
130-
"generic_search_term": "foo"
140+
"generic_search_term": "foo",
141+
"room_types": [null, "m.space"]
131142
},
132143
"include_all_networks": false,
133144
"third_party_instance_id": "irc"
@@ -185,7 +196,8 @@ paths:
185196
"room_id": "!ol19s:bleecker.street",
186197
"topic": "Tasty tasty cheese",
187198
"world_readable": true,
188-
"join_rule": "public"
199+
"join_rule": "public",
200+
"room_type": "m.space"
189201
}
190202
],
191203
"next_batch": "p190q",

0 commit comments

Comments
 (0)