Server notices: add an autojoin setting for the notices room#16699
Server notices: add an autojoin setting for the notices room#16699DMRobertson merged 5 commits intomatrix-org:developfrom MatMaul:server-notice-autojoin
Conversation
There was a problem hiding this comment.
FWIW this is against the spec:
Servers should invite the target user rather than automatically join them to the server notice room.
There was a problem hiding this comment.
Thanks, TIL server notices is specced :)
It's a SHOULD and not a MUST so I think it should be fine to have a config flag defaulting to false for that?
There was a problem hiding this comment.
FWIW I don't understand the spec's rationale and I think that auto-joining makes for a better UX.
Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com>
| if self._config.servernotices.server_notices_auto_join: | ||
| user_requester = create_requester( | ||
| user_id, authenticated_entity=self._server_name | ||
| ) | ||
| await self._room_member_handler.update_membership( | ||
| requester=user_requester, | ||
| target=user_id_obj, | ||
| room_id=room_id, | ||
| action="join", | ||
| ratelimit=False, | ||
| ) | ||
|
|
There was a problem hiding this comment.
I was a bit alarmed by this, because it looks like maybe_invite_user_to_room is a generic function. But I see from its docstring that it is specifically intended for server notices.
I also wondered if having the initial membership be invite might be confusing. But the room's join rules presumably require invites, so I think the invite->join transition is inevitable.
On reflection: LGTM.
DMRobertson
left a comment
There was a problem hiding this comment.
Thanks Mathieu, I think this is sensible.
Signed-off-by: Mathieu Velten mathieu.velten@beta.gouv.fr
Pull Request Checklist
(run the linters)