mirror of
https://github.com/matrix-org/matrix-spec
synced 2026-04-23 11:14:10 +02:00
address issues
This commit is contained in:
parent
53435d400d
commit
5ae462d558
|
|
@ -7,7 +7,7 @@ said room.
|
||||||
This proposal implements the reserved "knock" membership type for the `m.room.member` state event.
|
This proposal implements the reserved "knock" membership type for the `m.room.member` state event.
|
||||||
This state event indicates that a user knocks a room, that is asking for permission to join. It
|
This state event indicates that a user knocks a room, that is asking for permission to join. It
|
||||||
contains an optional "reason" parameter to specify the reason you want to join. Like other
|
contains an optional "reason" parameter to specify the reason you want to join. Like other
|
||||||
memtership types the parameters "displayname" and "avatar_url" are optional. This membership can
|
membership types the parameters "displayname" and "avatar_url" are optional. This membership can
|
||||||
be set from users who aren't currently in said room. An example for the membership would look as
|
be set from users who aren't currently in said room. An example for the membership would look as
|
||||||
follows:
|
follows:
|
||||||
```json
|
```json
|
||||||
|
|
@ -20,8 +20,10 @@ follows:
|
||||||
```
|
```
|
||||||
|
|
||||||
After a knock is received in a room it is expected to be displayed in the timeline, similar to other
|
After a knock is received in a room it is expected to be displayed in the timeline, similar to other
|
||||||
membership changes. Clients can optionally add a way for users of a room to review all current
|
membership changes. It is recommended to not display the reason until the user interacts with the
|
||||||
knocks. After a knock in a room a member of the room can invite the knocker.
|
client in some way (e.g. clicking on a "show reason" button), as else this would basically allow
|
||||||
|
outsiders to send messages into the room. Clients can optionally add a way for users of a room to
|
||||||
|
review all current knocks. After a knock in a room, a member of the room can invite the knocker.
|
||||||
|
|
||||||
To be able to implement this properly two new endpoints need to be added, one in the client-server
|
To be able to implement this properly two new endpoints need to be added, one in the client-server
|
||||||
API and one in the server-server API.
|
API and one in the server-server API.
|
||||||
|
|
@ -39,9 +41,9 @@ in public rooms. Additionally the new join rule "private" is introduced. This is
|
||||||
when creating a new room, prevent anyone from knocking.
|
when creating a new room, prevent anyone from knocking.
|
||||||
|
|
||||||
### Power levels
|
### Power levels
|
||||||
The default power level for "knock" is 0. If a user has a too low power level to knock they aren't
|
The default power level for "knock" is the default power level for the room. If a user has a too low
|
||||||
allowed to do this. As power levels can be set for users not currently in the room this can be used
|
power level to knock they aren't allowed to do this. As power levels can be set for users not currently
|
||||||
as a way to limit who can knock and who can't.
|
in the room this can be used as a way to limit who can knock and who can't.
|
||||||
|
|
||||||
#### Example:
|
#### Example:
|
||||||
`@alice:example.org` CAN knock, but `@bob:example.org` can't: The (incomplete) content of
|
`@alice:example.org` CAN knock, but `@bob:example.org` can't: The (incomplete) content of
|
||||||
|
|
@ -56,6 +58,13 @@ as a way to limit who can knock and who can't.
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Membership changes
|
||||||
|
Once someone has sent the `knock` membership into the room a change to the following memberships is
|
||||||
|
possible:
|
||||||
|
- `invite`: The knock was accepted by someone inside the room and they are inviting the knocker into
|
||||||
|
the room.
|
||||||
|
- `leave`: Similar to how kicks are handled, the knock was rejected.
|
||||||
|
|
||||||
## Client-Server API
|
## Client-Server API
|
||||||
Two new endpoints are introduced in the client-server API (similarly to join):
|
Two new endpoints are introduced in the client-server API (similarly to join):
|
||||||
`POST /_matrix/client/r0/rooms/{roomId}/knock` and `POST /_matrix/client/r0/knock/{roomIdOrAlias}`.
|
`POST /_matrix/client/r0/rooms/{roomId}/knock` and `POST /_matrix/client/r0/knock/{roomIdOrAlias}`.
|
||||||
|
|
@ -86,7 +95,8 @@ This request was invalid, e.g. bad JSON. Example reply:
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"errcode": "M_UNKNOWN",
|
"errcode": "M_UNKNOWN",
|
||||||
"error": "An unknown error occurred"}
|
"error": "An unknown error occurred"
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
##### Status code 403:
|
##### Status code 403:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue