3 ms·
Ah, sorry. I guess it took some time for me to grasp that, and I am now subject to the curse of knowledge. I maintain that for technical-minded people like me,
by MayeulC 5y ago
Ah, sorry. I guess it took some time for me to grasp that, and I am now subject to the curse of knowledge.
I maintain that for technical-minded people like me, knowing a bit of behind-the-scenes can help a lot with understanding (it did with git).
> How can spaces/rooms contain other rooms?
They don't per se. It's a list of rooms that's part of the room state. The room doesn't contain anything else than pointers to other rooms, like a linked list. And then other room-related stuff, like an avatar,name,memberlist,ban list, etc.
-------
For the technical explanation: what's a room in Matrix? The basic functionality is to store some data. There's three different kind of data: ephemeral (online/offline "presence" state, typing notifications...), persistent (part of the history: join, leave, message, attachment, etc), and state (room name, avatar, member list, etc). You can define your own custom data.
The added value is replicating that data across servers (that includes re-syncing after history diverges, like a CRDT), and checking it against some rules (somebody cannot join if they've not been invited and the room is private, or read history).
So spaces are just rooms, which indicate a special type ("m.space") in their state/creation event. Also in that state, they contain addresses of other rooms. Some of these rooms can be spaces as well.
--------
I'm not sure about a layman's perspective, but for me it always clicked that:
- rooms are just places where you can chat with other people
- you can be alone in the room, in which case stuff you write there is for yourself only
- you can later share that room with someone else
- or make it publicly accessible, maybe also discoverable by publishing it in the room directory
That permission model is quite intuitive IMO. If you create a google doc, it's the same. I often create rooms, set the avatar and permissions before inviting people over or making it public.