Skip to content

Commit 5ed4d1d

Browse files
committed
Clarify the meaning of "public rooms" in the room directory
Signed-off-by: Johannes Marbach <[email protected]>
1 parent 5bac209 commit 5ed4d1d

File tree

7 files changed

+62
-119
lines changed

7 files changed

+62
-119
lines changed

content/client-server-api/_index.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2831,7 +2831,27 @@ re-invited.
28312831

28322832
{{% http-api spec="client-server" api="banning" %}}
28332833

2834-
### Listing rooms
2834+
### Room directory
2835+
2836+
Homeservers MAY publish a room directory to allow users to discover rooms. A room
2837+
can have one of two visibility settings in the directory:
2838+
2839+
`public`
2840+
The room will be shown in the published room directory.
2841+
2842+
`private`
2843+
The room will be hidden from the published room directory.
2844+
2845+
Clients can define a room's initial visibility in the directory via the `visibility`
2846+
parameter in [`/createRoom`](#post_matrixclientv3createroom). Irrespective of room
2847+
creation, clients can query and change a room's visibility in the directory through
2848+
the endpoints listed below, provided that the server permits this.
2849+
2850+
{{% boxes/warning %}}
2851+
A visibility setting of `public` should not be confused with a `public` [join rule](#mroomjoin_rules)
2852+
or a `world_readable` [history visibility](#room-history-visibility). The visibility merely defines
2853+
whether a room is included in the published room directory or not.
2854+
{{% /boxes/warning %}}
28352855

28362856
{{% http-api spec="client-server" api="list_public_rooms" %}}
28372857

content/server-server-api.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1045,11 +1045,10 @@ user's Matrix ID and the token delivered when the invite was stored,
10451045
this verification will prove that the `m.room.member` invite event comes
10461046
from the user owning the invited third-party identifier.
10471047

1048-
## Public Room Directory
1048+
## Room Directory
10491049

1050-
To complement the [Client-Server
1051-
API](/client-server-api)'s room directory,
1052-
homeservers need a way to query the public rooms for another server.
1050+
To complement the [room directory in the Client-Server API](/client-server-api#room-directory),
1051+
homeservers need a way to query the published rooms of another server.
10531052
This can be done by making a request to the `/publicRooms` endpoint for
10541053
the server the room directory should be retrieved for.
10551054

data/api/client-server/create_room.yaml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,8 @@ paths:
8787
- public
8888
- private
8989
description: |-
90-
A `public` visibility indicates that the room will be shown
91-
in the published room list. A `private` visibility will hide
92-
the room from the published room list. Rooms default to
93-
`private` visibility if this key is not included. NB: This
94-
should not be confused with `join_rules` which also uses the
95-
word `public`.
90+
The room's visibility in the server's [room directory](#room-directory).
91+
Defaults to `private`.
9692
room_alias_name:
9793
type: string
9894
description: |-

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# limitations under the License.
1414

1515
type: object
16-
title: "PublicRoomsChunk"
16+
title: "PublishedRoomsChunk"
1717
properties:
1818
canonical_alias:
1919
type: string

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

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,28 +13,15 @@
1313
# limitations under the License.
1414

1515
type: object
16-
description: A list of the rooms on the server.
16+
description: A list of the published rooms on the server.
1717
required: ["chunk"]
1818
properties:
1919
chunk:
2020
type: array
2121
description: |-
22-
A paginated chunk of public rooms.
22+
A paginated chunk of published rooms.
2323
items:
24-
allOf:
25-
- $ref: "public_rooms_chunk.yaml"
26-
- type: object
27-
title: PublicRoomsChunk
28-
properties:
29-
# Override description of join_rule
30-
join_rule:
31-
type: string
32-
description: |-
33-
The room's join rule. When not present, the room is assumed to
34-
be `public`. Note that rooms with `invite` join rules are not
35-
expected here, but rooms with `knock` rules are given their
36-
near-public nature.
37-
example: "public"
24+
$ref: "public_rooms_chunk.yaml"
3825
next_batch:
3926
type: string
4027
description: |-
@@ -50,7 +37,7 @@ properties:
5037
total_room_count_estimate:
5138
type: integer
5239
description: |-
53-
An estimate on the total number of public rooms, if the
40+
An estimate on the total number of published rooms, if the
5441
server has an estimate.
5542
example: {
5643
"chunk": [

data/api/client-server/list_public_rooms.yaml

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ paths:
1919
"/directory/list/room/{roomId}":
2020
get:
2121
summary: Gets the visibility of a room in the directory
22-
description: Gets the visibility of a given room on the server's public room
23-
directory.
22+
description: Gets the visibility of a given room in the server's room directory.
2423
operationId: getRoomVisibilityOnDirectory
2524
parameters:
2625
- in: path
@@ -32,7 +31,7 @@ paths:
3231
type: string
3332
responses:
3433
"200":
35-
description: The visibility of the room in the directory
34+
description: The visibility of the room in the directory.
3635
content:
3736
application/json:
3837
schema:
@@ -50,7 +49,7 @@ paths:
5049
"visibility": "public"
5150
}
5251
"404":
53-
description: The room is not known to the server
52+
description: The room is not known to the server.
5453
content:
5554
application/json:
5655
schema:
@@ -66,12 +65,11 @@ paths:
6665
put:
6766
summary: Sets the visibility of a room in the room directory
6867
description: |-
69-
Sets the visibility of a given room in the server's public room
70-
directory.
68+
Sets the visibility of a given room in the server's room directory.
7169
72-
Servers may choose to implement additional access control checks
73-
here, for instance that room visibility can only be changed by
74-
the room creator or a server administrator.
70+
Servers MAY implement additional access control checks, for instance,
71+
to ensure that a room's visibility can only be changed by the room creator
72+
or a server administrator.
7573
operationId: setRoomVisibilityOnDirectory
7674
security:
7775
- accessTokenQuery: []
@@ -97,7 +95,7 @@ paths:
9795
- public
9896
description: |-
9997
The new visibility setting for the room.
100-
Defaults to 'public'.
98+
Defaults to `public`.
10199
example: {
102100
"visibility": "public"
103101
}
@@ -114,7 +112,7 @@ paths:
114112
response:
115113
value: {}
116114
"404":
117-
description: The room is not known to the server
115+
description: The room is not known to the server.
118116
content:
119117
application/json:
120118
schema:
@@ -129,9 +127,9 @@ paths:
129127
- Room discovery
130128
/publicRooms:
131129
get:
132-
summary: Lists the public rooms on the server.
130+
summary: Lists a server's published room directory
133131
description: |-
134-
Lists the public rooms on the server.
132+
Lists a server's published room directory.
135133
136134
This API returns paginated responses. The rooms are ordered by the number
137135
of joined members, with the largest rooms first.
@@ -154,23 +152,23 @@ paths:
154152
- in: query
155153
name: server
156154
description: |-
157-
The server to fetch the public room lists from. Defaults to the
155+
The server to fetch the room directory from. Defaults to the
158156
local server. Case sensitive.
159157
schema:
160158
type: string
161159
responses:
162160
"200":
163-
description: A list of the rooms on the server.
161+
description: A list of the published rooms on the server.
164162
content:
165163
application/json:
166164
schema:
167165
$ref: definitions/public_rooms_response.yaml
168166
tags:
169167
- Room discovery
170168
post:
171-
summary: Lists the public rooms on the server with optional filter.
169+
summary: Lists a server's published room directory with an optional filter
172170
description: |-
173-
Lists the public rooms on the server, with optional filter.
171+
Lists a server's published room directory with an optional filter.
174172
175173
This API returns paginated responses. The rooms are ordered by the number
176174
of joined members, with the largest rooms first.
@@ -182,7 +180,7 @@ paths:
182180
- in: query
183181
name: server
184182
description: |-
185-
The server to fetch the public room lists from. Defaults to the
183+
The server to fetch the room directory from. Defaults to the
186184
local server. Case sensitive.
187185
schema:
188186
type: string
@@ -253,7 +251,7 @@ paths:
253251
required: true
254252
responses:
255253
"200":
256-
description: A list of the rooms on the server.
254+
description: A filtered list of the published rooms on the server.
257255
content:
258256
application/json:
259257
schema:

data/api/server-server/public_rooms.yaml

Lines changed: 14 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,20 @@
1313
# limitations under the License.
1414
openapi: 3.1.0
1515
info:
16-
title: Matrix Federation Public Rooms API
16+
title: Matrix Federation Room Directory API
1717
version: 1.0.0
1818
paths:
1919
/publicRooms:
2020
get:
21-
summary: Get all the public rooms for a homeserver
21+
summary: Lists the server's published room directory.
2222
description: |-
23-
Gets all the public rooms for the homeserver. This should not return
24-
rooms that are listed on another homeserver's directory, just those
25-
listed on the receiving homeserver's directory.
23+
Lists the server's published room directory.
24+
25+
This API returns paginated responses. The rooms are ordered by the number
26+
of joined members, with the largest rooms first.
27+
28+
This should not return rooms that are listed on another homeserver's directory,
29+
just those listed on the receiving homeserver's directory.
2630
operationId: getPublicRooms
2731
security:
2832
- signedRequest: []
@@ -62,21 +66,18 @@ paths:
6266
type: string
6367
responses:
6468
"200":
65-
description: The public room list for the homeserver.
69+
description: A list of the published rooms on the server.
6670
content:
6771
application/json:
6872
schema:
6973
$ref: ../client-server/definitions/public_rooms_response.yaml
7074
post:
71-
summary: Gets the public rooms on the server with optional filter.
75+
summary: Lists the server's published room directory with an optional filter
7276
description: |-
73-
Lists the public rooms on the server, with optional filter.
77+
Lists the server's published room directory with an optional filter.
7478
7579
This API returns paginated responses. The rooms are ordered by the number
7680
of joined members, with the largest rooms first.
77-
78-
Note that this endpoint receives and returns the same format that is seen
79-
in the Client-Server API's `POST /publicRooms` endpoint.
8081
operationId: queryPublicRooms
8182
security:
8283
- signedRequest: []
@@ -147,69 +148,11 @@ paths:
147148
required: true
148149
responses:
149150
"200":
150-
description: A list of the rooms on the server.
151+
description: A filtered list of the published rooms on the server.
151152
content:
152153
application/json:
153154
schema:
154-
type: object
155-
description: A list of the rooms on the server.
156-
required:
157-
- chunk
158-
properties:
159-
chunk:
160-
title: PublicRoomsChunks
161-
type: array
162-
description: A paginated chunk of public rooms.
163-
items:
164-
allOf:
165-
- $ref: ../client-server/definitions/public_rooms_chunk.yaml
166-
- type: object
167-
properties:
168-
# Override description of join_rule
169-
join_rule:
170-
type: string
171-
description: |-
172-
The room's join rule. When not present, the room is assumed to
173-
be `public`. Note that rooms with `invite` join rules are not
174-
expected here, but rooms with `knock` rules are given their
175-
near-public nature.
176-
next_batch:
177-
type: string
178-
description: |-
179-
A pagination token for the response. The absence of this token
180-
means there are no more results to fetch and the client should
181-
stop paginating.
182-
prev_batch:
183-
type: string
184-
description: |-
185-
A pagination token that allows fetching previous results. The
186-
absence of this token means there are no results before this
187-
batch, i.e. this is the first batch.
188-
total_room_count_estimate:
189-
type: integer
190-
description: |-
191-
An estimate on the total number of public rooms, if the
192-
server has an estimate.
193-
examples:
194-
response:
195-
value: {
196-
"chunk": [
197-
{
198-
"avatar_url": "mxc://bleecker.street/CHEDDARandBRIE",
199-
"guest_can_join": false,
200-
"name": "CHEESE",
201-
"num_joined_members": 37,
202-
"room_id": "!ol19s:bleecker.street",
203-
"topic": "Tasty tasty cheese",
204-
"world_readable": true,
205-
"join_rule": "public",
206-
"room_type": "m.space"
207-
}
208-
],
209-
"next_batch": "p190q",
210-
"prev_batch": "p1902",
211-
"total_room_count_estimate": 115
212-
}
155+
$ref: ../client-server/definitions/public_rooms_response.yaml
213156
servers:
214157
- url: "{protocol}://{hostname}{basePath}"
215158
variables:

0 commit comments

Comments
 (0)