Matrix: no knock, and no restricted-room join #124

Closed
opened 2026-09-06 12:04:33 -04:00 by Salastil · 1 comment
Owner

A Matrix room can ask to be knocked on rather than joined, and a room in a space can
be restricted to members of that space. moho understands neither: joinMatrixRoom
knows one way in, and there is no occurrence of knock anywhere in the daemon.

So a knock room found in the directory search (#86) is a dead end - the join fails
with the server's refusal and there is nothing else to try - and a restricted room
gives an error that does not explain that being in the space is the way in.

What is needed

  • POST /knock/{roomIdOrAlias} with a reason, and the knocked state shown while it is
    pending: it is neither joined nor invited, and the room list has nowhere to put that
    today.
  • Handle the invite that answers a knock, and the withdrawal that answers a refusal.
  • For restricted rooms, read m.room.join_rules allow conditions and say which
    space grants entry, rather than failing with a bare 403.

Done looks like: a room that wants to be knocked on can be knocked on, and a
restricted room says what would let you in.

Reference: Element.

A Matrix room can ask to be knocked on rather than joined, and a room in a space can be restricted to members of that space. moho understands neither: `joinMatrixRoom` knows one way in, and there is no occurrence of `knock` anywhere in the daemon. So a knock room found in the directory search (#86) is a dead end - the join fails with the server's refusal and there is nothing else to try - and a restricted room gives an error that does not explain that being in the space is the way in. **What is needed** - `POST /knock/{roomIdOrAlias}` with a reason, and the knocked state shown while it is pending: it is neither joined nor invited, and the room list has nowhere to put that today. - Handle the invite that answers a knock, and the withdrawal that answers a refusal. - For restricted rooms, read `m.room.join_rules` `allow` conditions and say which space grants entry, rather than failing with a bare 403. **Done looks like:** a room that wants to be knocked on can be knocked on, and a restricted room says what would let you in. Reference: Element.
Salastil added the featureprotocol labels 2026-09-06 12:04:33 -04:00
Salastil removed the protocol label 2026-09-06 12:49:15 -04:00
Author
Owner

Finished — https://git.salastil.com/Salastil/nobilis/commit/5ddd786 and https://git.salastil.com/Salastil/moho/commit/8608c8d

POST /knock/{roomIdOrAlias} with a reason, which is all the people inside have to decide by. No buffer is made for a knock: it is not a join, and a row in the list would say it was — the answer arrives as an invitation, which the invite list already shows.

The room directory now says which rooms are which. A knock room's button says Knock and opens a prompt for the reason; a restricted room says "open to a space's members" and, if a join is tried anyway, explains that joining the space is what opens it rather than passing on a bare 403.

Verified as far as this account can: the endpoint, auth and body shape are right — knocking on a room the account is already in comes back M_FORBIDDEN: You don't have permission to knock, which is the server's own answer to that request. A successful knock needs a room with that join rule and a second account to answer it; that part is unproven here and is worth a look the next time one is to hand.

Finished — https://git.salastil.com/Salastil/nobilis/commit/5ddd786 and https://git.salastil.com/Salastil/moho/commit/8608c8d `POST /knock/{roomIdOrAlias}` with a reason, which is all the people inside have to decide by. No buffer is made for a knock: it is not a join, and a row in the list would say it was — the answer arrives as an invitation, which the invite list already shows. The room directory now says which rooms are which. A knock room's button says **Knock** and opens a prompt for the reason; a restricted room says "open to a space's members" and, if a join is tried anyway, explains that joining the space is what opens it rather than passing on a bare 403. Verified as far as this account can: the endpoint, auth and body shape are right — knocking on a room the account is already in comes back `M_FORBIDDEN: You don't have permission to knock`, which is the server's own answer to that request. A successful knock needs a room with that join rule and a second account to answer it; that part is unproven here and is worth a look the next time one is to hand.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Salastil/moho#124