mirror of
https://github.com/matrix-org/matrix-spec
synced 2026-05-02 07:04:09 +02:00
Compare commits
4 commits
589397ac40
...
c1087d2882
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c1087d2882 | ||
|
|
5d8bfd35be | ||
|
|
e9f219d53b | ||
|
|
fe6c97f498 |
1
changelogs/client_server/newsfragments/2292.feature
Normal file
1
changelogs/client_server/newsfragments/2292.feature
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
Add `m.forget_forced_upon_leave` capability for servers to transparently auto-forget rooms that the user leaves as per [MSC4267](https://github.com/matrix-org/matrix-spec-proposals/pull/4267).
|
||||||
1
changelogs/client_server/newsfragments/2298.feature
Normal file
1
changelogs/client_server/newsfragments/2298.feature
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
Add support for `m.room.redaction` events at the `PUT /rooms/{roomId}/send/{eventType}/{txnId}` endpoint, as per [MSC4169](https://github.com/matrix-org/matrix-spec-proposals/pull/4169).
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
Specified input validation for PDUs passed to federation membership endpoints.
|
||||||
|
|
@ -2619,6 +2619,40 @@ An example of the capability API's response for this capability is:
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### `m.forget_forced_upon_leave` capability
|
||||||
|
|
||||||
|
{{% added-in v="1.18" %}}
|
||||||
|
|
||||||
|
This capability has a single flag, `enabled`, which indicates whether or
|
||||||
|
not the server automatically forgets rooms which the user has left.
|
||||||
|
|
||||||
|
When `enabled` is `true` and the user leaves a room, the server will automatically
|
||||||
|
forget the room — just as if the user had called [`/forget`](#post_matrixclientv3roomsroomidforget)
|
||||||
|
themselves. This behavior applies irrespective of whether the user has left the
|
||||||
|
room on their own (through [`/leave`](#post_matrixclientv3roomsroomidleave)) or
|
||||||
|
has been kicked or banned from the room by another user.
|
||||||
|
|
||||||
|
When `enabled` is `false`, the server does not automatically forget rooms
|
||||||
|
upon leave. In this case, clients MAY distinguish the actions of leaving
|
||||||
|
and forgetting a room in their UI. Similarly, clients MAY retrieve and
|
||||||
|
visualize left but unforgotten rooms using a [filter](#filtering) with
|
||||||
|
`include_leave = true`.
|
||||||
|
|
||||||
|
When the capability or the `enabled` property are not present, clients SHOULD
|
||||||
|
assume that the server does not automatically forget rooms.
|
||||||
|
|
||||||
|
An example of the capability API's response for this capability is:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"capabilities": {
|
||||||
|
"m.forget_forced_upon_leave": {
|
||||||
|
"enabled": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
### `m.room_versions` capability
|
### `m.room_versions` capability
|
||||||
|
|
||||||
This capability describes the default and available room versions a
|
This capability describes the default and available room versions a
|
||||||
|
|
@ -3315,6 +3349,14 @@ the topic to be removed from the room.
|
||||||
|
|
||||||
#### Client behaviour
|
#### Client behaviour
|
||||||
|
|
||||||
|
{{% changed-in v="1.18" %}}
|
||||||
|
|
||||||
|
If the server advertises support for a spec version that supports it, clients
|
||||||
|
MAY use the [`PUT /rooms/{roomId}/send/{eventType}/{txnId}`](#put_matrixclientv3roomsroomidsendeventtypetxnid)
|
||||||
|
endpoint to send `m.room.redaction` events in all room versions.
|
||||||
|
|
||||||
|
They can also use the following endpoint.
|
||||||
|
|
||||||
{{% http-api spec="client-server" api="redaction" %}}
|
{{% http-api spec="client-server" api="redaction" %}}
|
||||||
|
|
||||||
### Forming relationships between events
|
### Forming relationships between events
|
||||||
|
|
|
||||||
|
|
@ -50,6 +50,12 @@ paths:
|
||||||
m.change_password:
|
m.change_password:
|
||||||
$ref: '#/components/schemas/booleanCapability'
|
$ref: '#/components/schemas/booleanCapability'
|
||||||
description: Capability to indicate if the user can change their password.
|
description: Capability to indicate if the user can change their password.
|
||||||
|
m.forget_forced_upon_leave:
|
||||||
|
x-addedInMatrixVersion: "1.18"
|
||||||
|
$ref: '#/components/schemas/booleanCapability'
|
||||||
|
description: |-
|
||||||
|
Capability to indicate if the server automatically forgets rooms once the user
|
||||||
|
leaves.
|
||||||
m.room_versions:
|
m.room_versions:
|
||||||
type: object
|
type: object
|
||||||
description: The room versions the server supports.
|
description: The room versions the server supports.
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,10 @@ paths:
|
||||||
"/rooms/{roomId}/leave":
|
"/rooms/{roomId}/leave":
|
||||||
post:
|
post:
|
||||||
summary: Stop the requesting user participating in a particular room.
|
summary: Stop the requesting user participating in a particular room.
|
||||||
|
x-changedInMatrixVersion:
|
||||||
|
"1.18": |-
|
||||||
|
Servers may additionally forget the room provided that they make this behavior
|
||||||
|
transparent.
|
||||||
description: |-
|
description: |-
|
||||||
This API stops a user participating in a particular room.
|
This API stops a user participating in a particular room.
|
||||||
|
|
||||||
|
|
@ -29,8 +33,15 @@ paths:
|
||||||
If the user was invited to the room, but had not joined, this call
|
If the user was invited to the room, but had not joined, this call
|
||||||
serves to reject the invite.
|
serves to reject the invite.
|
||||||
|
|
||||||
The user will still be allowed to retrieve history from the room which
|
Servers MAY additionally forget the room when this endpoint is called –
|
||||||
they were previously allowed to see.
|
just as if the user had also invoked [`/forget`](/client-server-api/#post_matrixclientv3roomsroomidforget).
|
||||||
|
Servers that do this, MUST inform clients about this behavior using the
|
||||||
|
[`m.forget_forced_upon_leave`](/client-server-api/#mforget_forced_upon_leave-capability)
|
||||||
|
capability.
|
||||||
|
|
||||||
|
If the server doesn't automatically forget the room, the user will still be
|
||||||
|
allowed to retrieve history from the room which they were previously allowed
|
||||||
|
to see.
|
||||||
operationId: leaveRoom
|
operationId: leaveRoom
|
||||||
security:
|
security:
|
||||||
- accessTokenQuery: []
|
- accessTokenQuery: []
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,10 @@ paths:
|
||||||
"/rooms/{roomId}/send/{eventType}/{txnId}":
|
"/rooms/{roomId}/send/{eventType}/{txnId}":
|
||||||
put:
|
put:
|
||||||
summary: Send a message event to the given room.
|
summary: Send a message event to the given room.
|
||||||
|
x-changedInMatrixVersion:
|
||||||
|
"1.18": |-
|
||||||
|
Homeservers must support sending `m.room.redaction` events with this endpoint
|
||||||
|
for all room versions.
|
||||||
description: |-
|
description: |-
|
||||||
This endpoint is used to send a message event to a room. Message events
|
This endpoint is used to send a message event to a room. Message events
|
||||||
allow access to historical events and pagination, making them suited
|
allow access to historical events and pagination, making them suited
|
||||||
|
|
@ -28,6 +32,11 @@ paths:
|
||||||
The body of the request should be the content object of the event; the
|
The body of the request should be the content object of the event; the
|
||||||
fields in this object will vary depending on the type of event. See
|
fields in this object will vary depending on the type of event. See
|
||||||
[Room Events](/client-server-api/#room-events) for the m. event specification.
|
[Room Events](/client-server-api/#room-events) for the m. event specification.
|
||||||
|
|
||||||
|
Homeservers MUST allow clients to send `m.room.redaction` events with this
|
||||||
|
endpoint for all room versions. In rooms with a version older than 11 they
|
||||||
|
MUST move the `redacts` property inside the `content` to the top level of
|
||||||
|
the event.
|
||||||
operationId: sendMessage
|
operationId: sendMessage
|
||||||
security:
|
security:
|
||||||
- accessTokenQuery: []
|
- accessTokenQuery: []
|
||||||
|
|
|
||||||
|
|
@ -172,6 +172,17 @@ paths:
|
||||||
}
|
}
|
||||||
"400":
|
"400":
|
||||||
description: |-
|
description: |-
|
||||||
|
The `M_INVALID_PARAM` error code is used to indicate one or more of the following:
|
||||||
|
|
||||||
|
* The invite event fails a [signature check](/server-server-api/#validating-hashes-and-signatures-on-received-events).
|
||||||
|
* The event type is not `m.room.member`.
|
||||||
|
* The `membership` field inside the event content is not `invite`.
|
||||||
|
* The event sender is not a user ID on the origin server.
|
||||||
|
* The `state_key` is not a user ID on the receiving server.
|
||||||
|
|
||||||
|
Servers MUST apply the validation above to the invite event before
|
||||||
|
signing it regardless of room version.
|
||||||
|
|
||||||
The `M_MISSING_PARAM` error code is used to indicate one or more of
|
The `M_MISSING_PARAM` error code is used to indicate one or more of
|
||||||
the following:
|
the following:
|
||||||
|
|
||||||
|
|
@ -186,9 +197,9 @@ paths:
|
||||||
Servers MAY apply the validation above to room versions 1 through 11,
|
Servers MAY apply the validation above to room versions 1 through 11,
|
||||||
and SHOULD apply the validation above to all other room versions.
|
and SHOULD apply the validation above to all other room versions.
|
||||||
|
|
||||||
If `M_MISSING_PARAM` is returned and the request is associated with a
|
If `M_MISSING_PARAM` or `M_INVALID_PARAM` is returned and the request
|
||||||
Client-Server API request, the Client-Server API request SHOULD fail
|
is associated with a Client-Server API request, the Client-Server API
|
||||||
with a 5xx error rather than being passed through.
|
request SHOULD fail with a 5xx error rather than being passed through.
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
|
|
|
||||||
|
|
@ -154,6 +154,17 @@ paths:
|
||||||
The error should be passed through to clients so that they
|
The error should be passed through to clients so that they
|
||||||
may give better feedback to users.
|
may give better feedback to users.
|
||||||
|
|
||||||
|
The `M_INVALID_PARAM` error code is used to indicate one or more of the following:
|
||||||
|
|
||||||
|
* The invite event fails a [signature check](/server-server-api/#validating-hashes-and-signatures-on-received-events).
|
||||||
|
* The event type is not `m.room.member`.
|
||||||
|
* The `membership` field inside the event content is not `invite`.
|
||||||
|
* The event sender is not a user ID on the origin server.
|
||||||
|
* The `state_key` is not a user ID on the receiving server.
|
||||||
|
|
||||||
|
Servers MUST apply the validation above to the invite event before
|
||||||
|
signing it regardless of room version.
|
||||||
|
|
||||||
The `M_MISSING_PARAM` error code is used to indicate one or more of
|
The `M_MISSING_PARAM` error code is used to indicate one or more of
|
||||||
the following:
|
the following:
|
||||||
|
|
||||||
|
|
@ -168,9 +179,9 @@ paths:
|
||||||
Servers MAY apply the validation above to room versions 1 through 11,
|
Servers MAY apply the validation above to room versions 1 through 11,
|
||||||
and SHOULD apply the validation above to all other room versions.
|
and SHOULD apply the validation above to all other room versions.
|
||||||
|
|
||||||
If `M_MISSING_PARAM` is returned and the request is associated with a
|
If `M_MISSING_PARAM` or `M_INVALID_PARAM` is returned and the request
|
||||||
Client-Server API request, the Client-Server API request SHOULD fail
|
is associated with a Client-Server API request, the Client-Server API
|
||||||
with a 5xx error rather than being passed through.
|
request SHOULD fail with a 5xx error rather than being passed through.
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ paths:
|
||||||
type: string
|
type: string
|
||||||
- in: path
|
- in: path
|
||||||
name: userId
|
name: userId
|
||||||
description: The user ID the join event will be for.
|
description: The user ID the join event will be for. This MUST be a user ID on the origin server.
|
||||||
required: true
|
required: true
|
||||||
example: "@someone:example.org"
|
example: "@someone:example.org"
|
||||||
schema:
|
schema:
|
||||||
|
|
@ -388,6 +388,43 @@ paths:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
"400":
|
||||||
|
description: |-
|
||||||
|
The request is invalid in some way.
|
||||||
|
|
||||||
|
The `M_INVALID_PARAM` error code is used to indicate one or more of the following:
|
||||||
|
|
||||||
|
* The join event fails a [signature check](/server-server-api/#validating-hashes-and-signatures-on-received-events).
|
||||||
|
* The event type is not `m.room.member`.
|
||||||
|
* The `membership` field inside the event content is not `join`.
|
||||||
|
* The event sender is not a user ID on the origin server.
|
||||||
|
* The `state_key` is not equal to the `sender`.
|
||||||
|
|
||||||
|
Servers MUST apply the validation above to the join event.
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: ../client-server/definitions/errors/error.yaml
|
||||||
|
examples:
|
||||||
|
response:
|
||||||
|
value: {
|
||||||
|
"errcode": "M_INVALID_PARAM",
|
||||||
|
"error": "Not a join event."
|
||||||
|
}
|
||||||
|
"403":
|
||||||
|
description: |-
|
||||||
|
The room that the joining server is attempting to join does not permit the user
|
||||||
|
to join.
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: ../client-server/definitions/errors/error.yaml
|
||||||
|
examples:
|
||||||
|
response:
|
||||||
|
value: {
|
||||||
|
"errcode": "M_FORBIDDEN",
|
||||||
|
"error": "You are not invited to this room"
|
||||||
|
}
|
||||||
servers:
|
servers:
|
||||||
- url: "{protocol}://{hostname}{basePath}"
|
- url: "{protocol}://{hostname}{basePath}"
|
||||||
variables:
|
variables:
|
||||||
|
|
|
||||||
|
|
@ -247,6 +247,16 @@ paths:
|
||||||
The error should be passed through to clients so that they
|
The error should be passed through to clients so that they
|
||||||
may give better feedback to users.
|
may give better feedback to users.
|
||||||
|
|
||||||
|
The `M_INVALID_PARAM` error code is used to indicate one or more of the following:
|
||||||
|
|
||||||
|
* The join event fails a [signature check](/server-server-api/#validating-hashes-and-signatures-on-received-events).
|
||||||
|
* The event type is not `m.room.member`.
|
||||||
|
* The `membership` field inside the event content is not `join`.
|
||||||
|
* The event sender is not a user ID on the origin server.
|
||||||
|
* The `state_key` is not equal to the `sender`.
|
||||||
|
|
||||||
|
Servers MUST apply the validation above to the join event.
|
||||||
|
|
||||||
New in `v1.2`, the following error conditions might happen:
|
New in `v1.2`, the following error conditions might happen:
|
||||||
|
|
||||||
If the room is [restricted](/client-server-api/#restricted-rooms)
|
If the room is [restricted](/client-server-api/#restricted-rooms)
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ paths:
|
||||||
type: string
|
type: string
|
||||||
- in: path
|
- in: path
|
||||||
name: userId
|
name: userId
|
||||||
description: The user ID the knock event will be for.
|
description: The user ID the knock event will be for. This MUST be a user ID on the origin server.
|
||||||
required: true
|
required: true
|
||||||
example: "@someone:example.org"
|
example: "@someone:example.org"
|
||||||
schema:
|
schema:
|
||||||
|
|
@ -330,6 +330,27 @@ paths:
|
||||||
"$ref": "./examples/invite_or_knock_state.json"
|
"$ref": "./examples/invite_or_knock_state.json"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
"400":
|
||||||
|
description: |-
|
||||||
|
The `M_INVALID_PARAM` error code is used to indicate one or more of the following:
|
||||||
|
|
||||||
|
* The knock event fails a [signature check](/server-server-api/#validating-hashes-and-signatures-on-received-events).
|
||||||
|
* The event type is not `m.room.member`.
|
||||||
|
* The `membership` field inside the event content is not `knock`.
|
||||||
|
* The event sender is not a user ID on the origin server.
|
||||||
|
* The `state_key` is not equal to the `sender`.
|
||||||
|
|
||||||
|
Servers MUST apply the validation above to the knock event.
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: ../client-server/definitions/errors/error.yaml
|
||||||
|
examples:
|
||||||
|
response:
|
||||||
|
value: {
|
||||||
|
"errcode": "M_INVALID_PARAM",
|
||||||
|
"error": "Not a knock event."
|
||||||
|
}
|
||||||
"403":
|
"403":
|
||||||
description: |-
|
description: |-
|
||||||
The knocking server or user is not permitted to knock on the room, such as when the
|
The knocking server or user is not permitted to knock on the room, such as when the
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ paths:
|
||||||
type: string
|
type: string
|
||||||
- in: path
|
- in: path
|
||||||
name: userId
|
name: userId
|
||||||
description: The user ID the leave event will be for.
|
description: The user ID the leave event will be for. This MUST be a user ID on the origin server.
|
||||||
required: true
|
required: true
|
||||||
example: "@someone:example.org"
|
example: "@someone:example.org"
|
||||||
schema:
|
schema:
|
||||||
|
|
@ -249,6 +249,27 @@ paths:
|
||||||
200,
|
200,
|
||||||
{}
|
{}
|
||||||
]
|
]
|
||||||
|
"400":
|
||||||
|
description: |-
|
||||||
|
The `M_INVALID_PARAM` error code is used to indicate one or more of the following:
|
||||||
|
|
||||||
|
* The leave event fails a [signature check](/server-server-api/#validating-hashes-and-signatures-on-received-events).
|
||||||
|
* The event type is not `m.room.member`.
|
||||||
|
* The `membership` field inside the event content is not `leave`.
|
||||||
|
* The event sender is not a user ID on the origin server.
|
||||||
|
* The `state_key` is not equal to the `sender`.
|
||||||
|
|
||||||
|
Servers MUST apply the validation above to the leave event.
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: ../client-server/definitions/errors/error.yaml
|
||||||
|
examples:
|
||||||
|
response:
|
||||||
|
value: {
|
||||||
|
"errcode": "M_INVALID_PARAM",
|
||||||
|
"error": "Not a leave event."
|
||||||
|
}
|
||||||
servers:
|
servers:
|
||||||
- url: "{protocol}://{hostname}{basePath}"
|
- url: "{protocol}://{hostname}{basePath}"
|
||||||
variables:
|
variables:
|
||||||
|
|
|
||||||
|
|
@ -134,6 +134,27 @@ paths:
|
||||||
examples:
|
examples:
|
||||||
response:
|
response:
|
||||||
value: {}
|
value: {}
|
||||||
|
"400":
|
||||||
|
description: |-
|
||||||
|
The `M_INVALID_PARAM` error code is used to indicate one or more of the following:
|
||||||
|
|
||||||
|
* The leave event fails a [signature check](/server-server-api/#validating-hashes-and-signatures-on-received-events).
|
||||||
|
* The event type is not `m.room.member`.
|
||||||
|
* The `membership` field inside the event content is not `leave`.
|
||||||
|
* The event sender is not a user ID on the origin server.
|
||||||
|
* The `state_key` is not equal to the `sender`.
|
||||||
|
|
||||||
|
Servers MUST apply the validation above to the leave event.
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: ../client-server/definitions/errors/error.yaml
|
||||||
|
examples:
|
||||||
|
response:
|
||||||
|
value: {
|
||||||
|
"errcode": "M_INVALID_PARAM",
|
||||||
|
"error": "Not a leave event."
|
||||||
|
}
|
||||||
servers:
|
servers:
|
||||||
- url: "{protocol}://{hostname}{basePath}"
|
- url: "{protocol}://{hostname}{basePath}"
|
||||||
variables:
|
variables:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue