Skip to content

Commit

Permalink
Add room_types and room_type to /publicRooms
Browse files Browse the repository at this point in the history
  • Loading branch information
turt2live committed Aug 3, 2022
1 parent b36d4ef commit 7c833d5
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 8 deletions.
1 change: 1 addition & 0 deletions changelogs/client_server/newsfragments/1199.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add `room_types` filter and `room_type` response to `/publicRooms`, as per [MSC3827](https://github.com/matrix-org/matrix-spec-proposals/pull/3827).
5 changes: 5 additions & 0 deletions data/api/client-server/definitions/public_rooms_chunk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ properties:
The room's join rule. When not present, the room is assumed to
be `public`.
example: "public"
room_type:
type: string
x-addedInMatrixVersion: "1.4"
description: |-
The `type` of room (from [`m.room.create`](/client-server-api/#mroomcreate)), if any.
required:
- room_id
- num_joined_members
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ example: {
"room_id": "!ol19s:bleecker.street",
"topic": "Tasty tasty cheese",
"world_readable": true,
"join_rule": "public"
"join_rule": "public",
"room_type": "m.space"
}
],
"next_batch": "p190q",
Expand Down
17 changes: 14 additions & 3 deletions data/api/client-server/list_public_rooms.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,18 @@ paths:
generic_search_term:
type: string
description: |-
A string to search for in the room metadata, e.g. name,
topic, canonical alias etc. (Optional).
An optional string to search for in the room metadata, e.g. name,
topic, canonical alias, etc.
room_types:
type: array
x-addedInMatrixVersion: "1.4"
items:
type: string
description: |-
An optional list of [room types](/client-server-api/#types) to search
for. To include rooms without a room type, specify `null` within this
list. When not specified, all applicable rooms (regardless of type)
are returned.
include_all_networks:
type: boolean
description: |-
Expand All @@ -215,7 +225,8 @@ paths:
example: {
"limit": 10,
"filter": {
"generic_search_term": "foo"
"generic_search_term": "foo",
"room_types": [null, "m.space"]
},
"include_all_networks": false,
"third_party_instance_id": "irc"
Expand Down
1 change: 1 addition & 0 deletions data/api/client-server/space_hierarchy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ paths:
- type: object
title: ChildRoomsChunk
properties:
# Override x-addedInMatrixVersion for room_type (this endpoint had it first)
room_type:
type: string
description: |-
Expand Down
20 changes: 16 additions & 4 deletions data/api/server-server/public_rooms.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,18 @@ paths:
generic_search_term:
type: string
description: |-
A string to search for in the room metadata, e.g. name,
topic, canonical alias etc. (Optional).
An optional string to search for in the room metadata, e.g. name,
topic, canonical alias, etc.
room_types:
type: array
x-addedInMatrixVersion: "1.4"
items:
type: string
description: |-
An optional list of [room types](/client-server-api/#types) to search
for. To include rooms without a room type, specify `null` within this
list. When not specified, all applicable rooms (regardless of type)
are returned.
include_all_networks:
type: boolean
description: |-
Expand All @@ -127,7 +137,8 @@ paths:
example: {
"limit": 10,
"filter": {
"generic_search_term": "foo"
"generic_search_term": "foo",
"room_types": [null, "m.space"]
},
"include_all_networks": false,
"third_party_instance_id": "irc"
Expand Down Expand Up @@ -185,7 +196,8 @@ paths:
"room_id": "!ol19s:bleecker.street",
"topic": "Tasty tasty cheese",
"world_readable": true,
"join_rule": "public"
"join_rule": "public",
"room_type": "m.space"
}
],
"next_batch": "p190q",
Expand Down

0 comments on commit 7c833d5

Please sign in to comment.