-
Notifications
You must be signed in to change notification settings - Fork 391
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MSCXXXX: Automatically forgetting rooms on leave
Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
- Loading branch information
Showing
1 changed file
with
70 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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,70 @@ | ||
# MSCXXXX: Automatically forgetting rooms on leave | ||
|
||
Matrix discriminates between "leaving" and "forgetting" a room. | ||
[`/_matrix/client/v3/rooms/{roomId}/leave`] stops a user participating in a room | ||
but still allows them to retrieve history. A subsequent call to | ||
[`/_matrix/client/v3/rooms/{roomId}/forget`] then stops the user from being able | ||
to retrieve history. | ||
|
||
Clients don't always differentiate these two operations in their UI and may only | ||
offer leaving without forgetting a room. Thus, some servers automatically forget | ||
rooms when a user leaves them in order to more aggressively free up their | ||
resources. One example of this is the [`forget_rooms_on_leave`] config option in | ||
Synapse. | ||
|
||
The present proposal seeks to standaradize this proprietary behaviour. | ||
|
||
## Proposal | ||
|
||
When a user leaves a room, either through | ||
[`/_matrix/client/v3/rooms/{roomId}/leave`] or by being kicked or banned, | ||
Servers MAY automatically forget the room – as if the user had called | ||
[`/_matrix/client/v3/rooms/{roomId}/forget`] themselves. | ||
|
||
This can limit clients' options to maintain an archive of historic rooms (such | ||
that they have left *without* forgetting them). Therefore, servers that | ||
auto-forget rooms MUST advertise that they do so via an `m.leave_without_forget` | ||
capability. | ||
|
||
``` json5 | ||
{ | ||
"capabilities": { | ||
"m.leave_without_forget": { | ||
"enabled": true | ||
} | ||
} | ||
} | ||
``` | ||
|
||
A value of `false` means that the server performs auto-forget so that the client | ||
cannot leave rooms without also forgetting them. A value of `true` means that | ||
rooms will only be forgotten when the clients calls | ||
[`/_matrix/client/v3/rooms/{roomId}/forget`]. | ||
|
||
When the capability is missing, clients SHOULD assume that the server does not | ||
auto-forget. | ||
|
||
## Potential issues | ||
|
||
None. | ||
|
||
## Alternatives | ||
|
||
None. | ||
|
||
## Security considerations | ||
|
||
None. | ||
|
||
## Unstable prefix | ||
|
||
While this proposal is unstable, clients should refer to | ||
`m.leave_without_forget` as `org.matrix.mscXXXX.leave_without_forget`. | ||
|
||
## Dependencies | ||
|
||
None. | ||
|
||
[`/_matrix/client/v3/rooms/{roomId}/leave`]: https://spec.matrix.org/v1.13/client-server-api/#post_matrixclientv3roomsroomidleave | ||
[`/_matrix/client/v3/rooms/{roomId}/forget`]: https://spec.matrix.org/v1.13/client-server-api/#post_matrixclientv3roomsroomidforget | ||
[`forget_rooms_on_leave`]: https://github.com/element-hq/synapse/blob/12dc6b102f071eb2eb84f2cff4cf92903276ffbb/synapse/config/room.py#L88 |