@@ -407,21 +407,26 @@ the sender permission to send the event. The `auth_events` for the
407407` m.room.create ` event in a room is empty; for other events, it should be
408408the following subset of the room state:
409409
410- - The ` m.room.create ` event.
410+ - The ` m.room.create ` event.
411411
412- - The current ` m.room.power_levels ` event, if any.
412+ - The current ` m.room.power_levels ` event, if any.
413413
414- - The sender's current ` m.room.member ` event, if any.
414+ - The sender's current ` m.room.member ` event, if any.
415415
416- - If type is ` m.room.member ` :
416+ - If type is ` m.room.member ` :
417417
418- - The target's current ` m.room.member ` event, if any.
419- - If ` membership ` is ` join ` or ` invite ` , the current
420- ` m.room.join_rules ` event, if any.
421- - If membership is ` invite ` and ` content ` contains a
422- ` third_party_invite ` property, the current
423- ` m.room.third_party_invite ` event with ` state_key ` matching
424- ` content.third_party_invite.signed.token ` , if any.
418+ - The target's current ` m.room.member ` event, if any.
419+ - If ` membership ` is ` join ` or ` invite ` , the current
420+ ` m.room.join_rules ` event, if any.
421+ - If membership is ` invite ` and ` content ` contains a
422+ ` third_party_invite ` property, the current
423+ ` m.room.third_party_invite ` event with ` state_key ` matching
424+ ` content.third_party_invite.signed.token ` , if any.
425+ - If ` content.join_authorised_via_users_server ` is present,
426+ the ` m.room.member ` event with ` state_key ` matching
427+ ` content.join_authorised_via_users_server ` . Due to the
428+ auth rules for the event, the target membership event should
429+ always be eligible for inclusion.
425430
426431#### Rejection
427432
@@ -721,15 +726,41 @@ To complete the join handshake, the joining server must now submit this
721726new event to a resident homeserver, by using the ` PUT /send_join `
722727endpoint.
723728
724- The resident homeserver then accepts this event into the room's event
725- graph, and responds to the joining server with the full set of state for
726- the newly-joined room. The resident server must also send the event to
727- other servers participating in the room.
729+ the resident homeserver then adds its signature to this event and
730+ accepts it into the room's event graph. The joining server receives
731+ the full set of state for the newly-joined room. The resident server
732+ must also send the event to other servers participating in the room.
728733
729734{{% http-api spec="server-server" api="joins-v1" %}}
730735
731736{{% http-api spec="server-server" api="joins-v2" %}}
732737
738+ ### Restricted rooms
739+
740+ Restricted rooms are described in detail in the
741+ [ client-server API] ( /client-server-api/#restricted-rooms ) and are available
742+ in room versions based on [ v8] ( /rooms/v8 ) .
743+
744+ A resident server attempting to join a server to a restricted room must
745+ ensure that the joining server satisfies at least one of the conditions
746+ specified by ` m.room.join_rules ` . If no conditions are available, or none
747+ match the required schema, then the joining server is considered to have
748+ failed all conditions.
749+
750+ The resident server uses a 400 ` M_UNABLE_TO_AUTHORISE_JOIN ` error on
751+ ` /make_join ` and ` /send_join ` to denote that the resident server is unable
752+ to validate any of the conditions, usually because the resident server
753+ does not have state information about rooms required by the conditions.
754+
755+ The resident server uses a 400 ` M_UNABLE_TO_GRANT_JOIN ` error on ` /make_join `
756+ and ` /send_join ` to denote that the joining server satisfies at least
757+ one of the conditions, though the resident server would be unable to
758+ meet the auth rules governing ` join_authorised_via_users_server ` on the
759+ resulting ` m.room.member ` event.
760+
761+ If the joining server fails all conditions then a 403 ` M_FORBIDDEN ` error
762+ is used by the resident server.
763+
733764## Knocking upon a room
734765
735766Rooms can permit knocking through the join rules, and if permitted this
0 commit comments