-
Notifications
You must be signed in to change notification settings - Fork 399
MSC3827: Filtering of /publicRooms
by room type
#3827
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 7 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
1d6acfc
Write `Filtering of /publicRooms by room type`
SimonBrandner 4140ec3
Improve wording to be more clear
SimonBrandner ae782b1
Specify handling of edge cases
SimonBrandner 748b258
Use plural
SimonBrandner f5ca17f
Don't change the defautl behaviour
SimonBrandner 3382b6a
Specify POST
SimonBrandner b1f0e90
Specify POST and GET
SimonBrandner 8b07b71
Improve wording
SimonBrandner f0f054e
Link to the original spec
SimonBrandner File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
# MSC3827: Filtering of `/publicRooms` by room type | ||
|
||
[MSC1772](https://github.com/matrix-org/matrix-doc/pull/1772) defines Spaces as | ||
rooms with `type` of `m.space`. One of the most requested features for Spaces is | ||
to have [a way to to discover | ||
them](https://github.com/vector-im/element-web/issues/17264). To solve this | ||
issue, this MSC proposes a mechanism for filtering the response of | ||
`/publicRooms` by room type. | ||
|
||
## Proposal | ||
|
||
This MSC proposes adding a `room_types` filter to the `POST /publicRooms` endpoint. | ||
The value of `room_types` is an array of room types - possible values of the | ||
`type` field in the `m.room.create` state event - which should be returned. | ||
SimonBrandner marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
An example request could look like this: | ||
|
||
```HTTP | ||
POST /_matrix/client/v3/publicRooms | ||
{ | ||
"filter": { | ||
"room_types": ["m.space"] | ||
}, | ||
"limit": 10 | ||
} | ||
``` | ||
|
||
The response for both `POST /publicRooms` and `GET /publicRooms` is also modified to include a `room_type` field, so that clients can show | ||
the room type metadata. | ||
|
||
```json | ||
{ | ||
"chunk": [{ | ||
"avatar_url": "mxc://bleecker.street/CHEDDARandBRIE", | ||
"guest_can_join": false, | ||
"join_rule": "public", | ||
"name": "CHEESE", | ||
"num_joined_members": 37, | ||
"room_id": "!ol19s:bleecker.street", | ||
"topic": "Tasty tasty cheese", | ||
"world_readable": true, | ||
"room_type": "m.space" | ||
}], | ||
"next_batch": "p190q", | ||
"prev_batch": "p1902", | ||
"total_room_count_estimate": 115 | ||
} | ||
``` | ||
|
||
If the client wants to get rooms of the default type, it should include `null` | ||
in the `room_types` array. If the `room_types` filter is not specified or the | ||
`room_types` array is empty, the server should return _all_ rooms no matter the | ||
type. | ||
|
||
## Alternatives | ||
|
||
### Using a special endpoint | ||
|
||
A special endpoint for spaces and other room types could be used. Then each new | ||
room type would require a special MSC and there would be no way to filter by | ||
custom room types. Filtering by multiple types would be impossible. | ||
|
||
### Replacing the room directory with a server-wide space | ||
|
||
[A matrix-spec issue](https://github.com/matrix-org/matrix-spec/issues/830) | ||
suggests replacing the room directory with a server-wide space; while this | ||
solution certainly has benefits, it would require a lot of changes both on the | ||
client and the server side. | ||
|
||
## Unstable prefix | ||
|
||
While this MSC is not considered stable, implementations should use | ||
`org.matrix.msc3827` as a namespace. | ||
|
||
|Release |Development | | ||
|------------|-------------------------------| | ||
|`room_type` |`org.matrix.msc3827.room_type` | | ||
|`room_types`|`org.matrix.msc3827.room_types`| |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.