Expand description
Domains with sub-rooms, the Matrix way: a domain is a Space (a room whose
m.room.create carries type: m.space), a sub-room is linked by an
m.space.child state event in the space (state_key = child room id,
content via = servers) and, optionally, a back-link m.space.parent
in the child. Everything here is derived from ordinary state events, so no
extra table exists and federation can later carry it unchanged.
A space holds no chat. Child rooms keep their own store: DM/group stay in the closed ciphertext pump, channels/forum in the public plaintext store. Hierarchy is metadata only and is never purged.
Constants§
- SPACE_
TYPE m.room.createtypeof a domain.
Functions§
- hierarchy
GET /rooms/{roomId}/hierarchy(CS API v1). Breadth-first fromroot, each room once, only rooms the caller may see,max_depthlevels below the root.fromis an opaque offset token (the page cut is deterministic for a stable tree).Ok(None)when the root itself is not visible.- restricted_
allows - Whether
m.room.join_rulesisrestricted(or knock_restricted) and one of itsallowspaces hasuser_idjoined. Join rule for restricted rooms is read from state because therooms.join_rulecolumn only knows invite/public. - room_
type typefrom the room’sm.room.create.- validate_
space_ state - Rejects malformed
m.space.child/m.space.parentcontent. Empty{}is a removal and always valid; otherwiseviamust be a non-empty list of strings,order(if any) a short string of printable ASCII,suggested(if any) a bool.