Skip to content

Commit 745b58a

Browse files
JohennesHarHarLinksanoadragon453richvdh
committed
Clarify the meaning of "public rooms" in the room directory (matrix-org#2104)
Signed-off-by: Johannes Marbach <[email protected]> Co-authored-by: Kim Brose <[email protected]> Co-authored-by: Andrew Morgan <[email protected]> Co-authored-by: Richard van der Hoff <[email protected]>
1 parent f011b9e commit 745b58a

File tree

11 files changed

+92
-133
lines changed

11 files changed

+92
-133
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Rooms published in `/publicRooms` don't necessarily have `public` join rules or `world_readable` history visibility.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Rooms published in `/publicRooms` don't necessarily have `public` join rules or `world_readable` history visibility.

content/application-service-api.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -492,10 +492,10 @@ via the query string). It is expected that the application service use
492492
the transactions pushed to it to handle events rather than syncing with
493493
the user implied by `sender_localpart`.
494494
495-
#### Application service room directories
495+
#### Published room directories
496496
497-
Application services can maintain their own room directories for their
498-
defined third-party protocols. These room directories may be accessed by
497+
Application services can maintain their own published room directories for
498+
their defined third-party protocols. These directories may be accessed by
499499
clients through additional parameters on the `/publicRooms`
500500
client-server endpoint.
501501

content/client-server-api/_index.md

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2846,7 +2846,35 @@ re-invited.
28462846

28472847
{{% http-api spec="client-server" api="banning" %}}
28482848

2849-
### Listing rooms
2849+
### Published room directory
2850+
2851+
Homeservers MAY publish a room directory to allow users to discover rooms. A room
2852+
can have one of two visibility settings in the directory:
2853+
2854+
- `public`: The room will be shown in the published room directory.
2855+
- `private`: The room will be hidden from the published room directory.
2856+
2857+
Clients can define a room's initial visibility in the directory via the `visibility`
2858+
parameter in [`/createRoom`](#post_matrixclientv3createroom). Irrespective of room
2859+
creation, clients can query and change a room's visibility in the directory through
2860+
the endpoints listed below, provided that the server permits this.
2861+
2862+
{{% boxes/warning %}}
2863+
The visibility setting merely defines whether a room is included in the published
2864+
room directory or not. It doesn't make any guarantees about the room's
2865+
[join rule](#mroomjoin_rules) or [history visibility](#room-history-visibility).
2866+
2867+
In particular, a visibility setting of `public` should not be confused with a `public`
2868+
join rule. Rooms with a join rule of `knock`, for instance, could reasonably be published
2869+
in the directory, too.
2870+
2871+
Similarly, a visibility setting of `public` does not necessarily imply a `world_readable`
2872+
history visibility.
2873+
2874+
To increase performance or by preference, servers MAY apply additional filters when listing the
2875+
directory, for instance, by automatically excluding rooms with `invite` join rules
2876+
that are not `world_readable` regardless of their visibility.
2877+
{{% /boxes/warning %}}
28502878

28512879
{{% http-api spec="client-server" api="list_public_rooms" %}}
28522880

content/server-server-api.md

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

1051-
## Public Room Directory
1051+
## Published Room Directory
10521052

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

data/api/client-server/appservice_room_directory.yaml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,21 @@
1313
# limitations under the License.
1414
openapi: 3.1.0
1515
info:
16-
title: Matrix Client-Server Application Service Room Directory API
16+
title: Matrix Client-Server Application Service Published Room Directory API
1717
version: 1.0.0
1818
paths:
1919
"/directory/list/appservice/{networkId}/{roomId}":
2020
put:
21-
summary: Updates a room's visibility in the application service's room directory.
22-
description: |-
23-
Updates the visibility of a given room on the application service's room
21+
summary: |-
22+
Updates a room's visibility in the application service's published room
2423
directory.
24+
description: |-
25+
Updates the visibility of a given room in the application service's
26+
published room directory.
2527
26-
This API is similar to the room directory visibility API used by clients
27-
to update the homeserver's more general room directory.
28+
This API is similar to the
29+
[visibility API](/client-server-api#put_matrixclientv3directorylistroomroomid)
30+
used by clients to update the homeserver's more general published room directory.
2831
2932
This API requires the use of an application service access token (`as_token`)
3033
instead of a typical client's access_token. This API cannot be invoked by

data/api/client-server/create_room.yaml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,9 @@ 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
91+
[published room directory](/client-server-api#published-room-directory).
92+
Defaults to `private`.
9693
room_alias_name:
9794
type: string
9895
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: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,15 @@
1313
# limitations under the License.
1414
openapi: 3.1.0
1515
info:
16-
title: Matrix Client-Server Room Directory API
16+
title: Matrix Client-Server Published Room Directory API
1717
version: 1.0.0
1818
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: |-
23+
Gets the visibility of a given room in the server's
24+
published room directory.
2425
operationId: getRoomVisibilityOnDirectory
2526
parameters:
2627
- in: path
@@ -32,7 +33,7 @@ paths:
3233
type: string
3334
responses:
3435
"200":
35-
description: The visibility of the room in the directory
36+
description: The visibility of the room in the directory.
3637
content:
3738
application/json:
3839
schema:
@@ -50,7 +51,7 @@ paths:
5051
"visibility": "public"
5152
}
5253
"404":
53-
description: The room is not known to the server
54+
description: The room is not known to the server.
5455
content:
5556
application/json:
5657
schema:
@@ -64,14 +65,13 @@ paths:
6465
tags:
6566
- Room discovery
6667
put:
67-
summary: Sets the visibility of a room in the room directory
68+
summary: Sets the visibility of a room in the directory
6869
description: |-
69-
Sets the visibility of a given room in the server's public room
70-
directory.
70+
Sets the visibility of a given room in the server's published room directory.
7171
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.
72+
Servers MAY implement additional access control checks, for instance,
73+
to ensure that a room's visibility can only be changed by the room creator
74+
or a server administrator.
7575
operationId: setRoomVisibilityOnDirectory
7676
security:
7777
- accessTokenQuery: []
@@ -97,11 +97,11 @@ paths:
9797
- public
9898
description: |-
9999
The new visibility setting for the room.
100-
Defaults to 'public'.
100+
Defaults to `public`.
101101
example: {
102102
"visibility": "public"
103103
}
104-
description: The new visibility for the room on the room directory.
104+
description: The new visibility for the room in the published room directory.
105105
required: true
106106
responses:
107107
"200":
@@ -114,7 +114,7 @@ paths:
114114
response:
115115
value: {}
116116
"404":
117-
description: The room is not known to the server
117+
description: The room is not known to the server.
118118
content:
119119
application/json:
120120
schema:
@@ -129,9 +129,9 @@ paths:
129129
- Room discovery
130130
/publicRooms:
131131
get:
132-
summary: Lists the public rooms on the server.
132+
summary: Lists a server's published room directory
133133
description: |-
134-
Lists the public rooms on the server.
134+
Lists a server's published room directory.
135135
136136
This API returns paginated responses. The rooms are ordered by the number
137137
of joined members, with the largest rooms first.
@@ -154,23 +154,23 @@ paths:
154154
- in: query
155155
name: server
156156
description: |-
157-
The server to fetch the public room lists from. Defaults to the
158-
local server. Case sensitive.
157+
The server to fetch the published room directory from. Defaults
158+
to the local server. Case sensitive.
159159
schema:
160160
type: string
161161
responses:
162162
"200":
163-
description: A list of the rooms on the server.
163+
description: A list of the published rooms on the server.
164164
content:
165165
application/json:
166166
schema:
167167
$ref: definitions/public_rooms_response.yaml
168168
tags:
169169
- Room discovery
170170
post:
171-
summary: Lists the public rooms on the server with optional filter.
171+
summary: Lists a server's published room directory with an optional filter
172172
description: |-
173-
Lists the public rooms on the server, with optional filter.
173+
Lists a server's published room directory with an optional filter.
174174
175175
This API returns paginated responses. The rooms are ordered by the number
176176
of joined members, with the largest rooms first.
@@ -182,8 +182,8 @@ paths:
182182
- in: query
183183
name: server
184184
description: |-
185-
The server to fetch the public room lists from. Defaults to the
186-
local server. Case sensitive.
185+
The server to fetch the published room directory from. Defaults
186+
to the local server. Case sensitive.
187187
schema:
188188
type: string
189189
requestBody:
@@ -253,7 +253,7 @@ paths:
253253
required: true
254254
responses:
255255
"200":
256-
description: A list of the rooms on the server.
256+
description: A filtered list of the published rooms on the server.
257257
content:
258258
application/json:
259259
schema:

0 commit comments

Comments
 (0)