Skip to content

Commit 0e9020a

Browse files
authored
Allowing knocks to restricted rooms (#3787)
Combinatorials part 2
1 parent 09fc322 commit 0e9020a

File tree

1 file changed

+85
-0
lines changed

1 file changed

+85
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# MSC3787: Allowing knocks to restricted rooms
2+
3+
[Join rules](https://spec.matrix.org/v1.1/client-server-api/#mroomjoin_rules) define what conditions
4+
a user must meet in order to, well, join a room. With the current setup it is impossible to have more
5+
than one rule active at a time, which makes it difficult to allow anyone from room X to join, but also
6+
join if their knock was accepted. The room would instead have to choose which condition it favoured.
7+
8+
Though generic approaches to allow arbitrary mixing of join rules are possible, such as those noted
9+
in [MSC3613](https://github.com/matrix-org/matrix-spec-proposals/pull/3613) and
10+
[MSC3386](https://github.com/matrix-org/matrix-spec-proposals/pull/3386), this proposal aims to fill
11+
an immediate gap where rooms cannot allow knocks and also other join conditions through `restricted`
12+
join rules. This is done by introducing yet another join rule, per the discussion on MSC3613 (which
13+
was rejected in favour of the stop-gap approach described by this MSC).
14+
15+
Alternative MSCs, such as [MSC3386](https://github.com/matrix-org/matrix-spec-proposals/pull/3386),
16+
seek to redesign the join rules structure entirely. This proposal is intended to fill a notable gap
17+
while more complex MSCs work out their specifics.
18+
19+
## Proposal
20+
21+
In a new room version, we introduce a new `join_rule` for the
22+
[`m.room.join_rules`](https://spec.matrix.org/v1.2/client-server-api/#mroomjoin_rules) event. This
23+
new join rule would be called `knock_restricted` and inherit all of the behaviour of `knock` and
24+
`restricted` - whichever of the two join rules is satisfied first allows a prospective member to
25+
join. For example, a user can simply knock on the room (exactly as if the room was set up as `knock`
26+
only), or if they met the `allow` conditions in the join rules then they could join without invite
27+
(exactly as if the room was set up as `restricted` only).
28+
29+
The effect on the [authorization rules](https://spec.matrix.org/v1.2/rooms/v9/#authorization-rules)
30+
is as follows:
31+
32+
* Rule 4.3.5 (handling of `m.room.member` joins) gets amended to say "If `join_rule` is `restricted`
33+
or `knock_restricted`:"
34+
* Rule 4.7.1 (handling of `m.room.member` knocks) gets amended to say "If the `join_rule` is anything
35+
other than `knock` or `knock_restricted`, reject."
36+
37+
No other changes are required within the specification. Implementations might need to modify their
38+
checks to ensure they appropriately look up the `allow` key of an `m.room.join_rules` event when the
39+
`join_rule` is `restricted` *or* `knock_restricted` though.
40+
41+
## Potential issues
42+
43+
As a point of bikeshed, the name `knock_restricted` is not perfect. Alternative naming is possible,
44+
however the author points the reader to the introduction where this MSC is outlined as a stop-gap
45+
solution pending proper/formal addressing of the problem statement.
46+
47+
Clients will also need special rendering for this join rule. Such a user interface might be:
48+
49+
```
50+
This room is:
51+
[ ] Public
52+
[x] Private
53+
54+
Join rules (disabled when Public):
55+
[x] Allow members of `#space:example.org` to join
56+
[x] Allow knocking
57+
```
58+
59+
## Alternatives
60+
61+
[MSC3613](https://github.com/matrix-org/matrix-spec-proposals/pull/3613) is an obvious candidate
62+
given it paved the path for this MSC. Ultimately, MSC3613 was rejected on not technical grounds but
63+
rather pragmatic grounds: while we could support a system of mixing different join rules, the current
64+
set of join rules don't make sense to mix outside of `knock`+`restricted`. So, we introduce a new
65+
join rule for the exactly one useful case of mixing join rules.
66+
67+
[MSC3386](https://github.com/matrix-org/matrix-doc/pull/3386) and similar ideas favour a complete
68+
rebuild of the join rules system. While a potentially great change for Matrix, it doesn't feel proper
69+
for the short term.
70+
71+
## Security considerations
72+
73+
This MSC does not introduce too many new topics, so is not at risk of the same security considerations
74+
which would normally accompany a new join rule. At best, this MSC makes it possible for a room to be
75+
"less private" because of allowing knocks and other join conditions in the same room, however the rooms
76+
using this setup will be doing so deliberately.
77+
78+
## Unstable prefix
79+
80+
Implementations of this MSC should use `org.matrix.msc3787` for the room version, using room version 9
81+
for all other behaviours of the room.
82+
83+
## Dependencies
84+
85+
No relevant dependencies.

0 commit comments

Comments
 (0)