Re:Enter the Matrix – A technical overview and guide to all ...
by Promarged on Monday May 14, 2018 @04:34PM
(#17069202)
So if I understand it correctly the client-to-server API is simple but servers internally build a Git-like structure? Interesting design, I think I'll read the specs for how history is stored.
Re:Enter the Matrix – A technical overview and guide to all ...
by Arathorn on Monday May 14, 2018 @05:36PM
(#17069666)
Precisely. Matrix is a shameless rip-off of Git, but applied to realtime messaging.
Re:Enter the Matrix – A technical overview and guide to all ...
by e12e on Monday May 14, 2018 @06:14PM
(#17069932)
Seems we now just have to wait for the next generation that's a rip-off of piul[1] rather than git, and we'll be all set!
On a more serious note, this seems to be a trend; to model chat as a converging set of edits. From an architectural pov it sounds similar to Google wave and lotus notes.
If you want to send someone a message in Matrix it's indeed a trivial HTTP PUT; something like:
curl -XPOST -d '{"msgtype":"m.text", "body":"hello"}' 'https://example.com/_matrix/client/api/r0/rooms/!CvcvRuDYDzT...
However, what's happening under the hood is that you're not saying "Hi Bob, here's a message from Alice" - instead, you're saying "Hi everyone, I've added a message to the history of this room. Please can everyone sync their copy of the room with mine?". In other words, it's talking about the way the federation (server<->server) protocol is architected.
There literally isn't a way in the federation protocol to say "please send a message from Alice to Bob"; instead the way you do it is to say "create a room and invite Bob to it (if you don't have one already); add a message to the room's history, and once the history has synchronised with Bob's server he'll have a copy of the message too".