News for hackers. Stuff that matters.
Re:France Enters the Matrix by forty on Friday February 22, 2019 @03:50AM (#19223968)
I kind of agree with you, but I'll add that XMPP usage of XML is weird enough that it makes it hard it use a normal XML parser / producer. Honestly I really wanted to like XMPP. I read all the specs at the time, even started to write some code, but all I can say is that it really sucks. I haven't looked at matrix yet, I hope it's better
Re:France Enters the Matrix by olau on Friday February 22, 2019 @08:45AM (#19225181)
Indeed! I was in the same boat - also started writing a client, but wasted too much time on the stupid XML stream idea.

Basically, chatting is message oriented, but the XMPP inventors thought it would be neat to start the connection with a tag like <beginconversation> which would then be dangling for the whole connection, preventing the use of a simple DOM XML parser (remember this is many years ago) for each message.

Re:France Enters the Matrix by edhelas on Friday February 22, 2019 @05:33PM (#19229766)
Any XML parser that I know can parse XML in a stream, that's all you need to handle an incoming XMPP stream.

Just an example, here is the XML parser that I wrote in PHP https://github.com/movim/movim/blob/master/lib/moxl/src/Moxl... (127 lines), it basically handle the stream as an input and fire SimpleXML (can also be DOM XML) on the other hand.

This can handle thousands of XMPP messages (called stanza) per second :)

Re:France Enters the Matrix by forty on Saturday February 23, 2019 @04:09AM (#19232465)
Can it handle plaintext XML suddenly becoming TLS encrypted? Because that's also what happens on any XMPP connection. If it can, then great but I guess it's more an exception than the rule
Re:France Enters the Matrix by Arathorn on Friday February 22, 2019 @01:42PM (#19227859)
fwiw, in Matrix, to send a message, it's:

  curl 'https://matrix.org/_matrix/client/r0/rooms/!RXNcERlITUVszBNIPW%3Amatrix.org/send/m.room.message/123?access_token='$TOKEN -X PUT --data '{"msgtype":"m.text","body":"hello world"}'
and to receive messages it's:

  curl 'https://matrix.org/_matrix/client/r0/sync?access_token='$TOKEN
Hopefully this ends up being quite easy to work with :)
Re:France Enters the Matrix by edhelas on Friday February 22, 2019 @05:35PM (#19229778)
and for XMPP

    <message to="[email protected]"><body>Hello world</body></message>
No need for a token, the socket you're in is already authenticated :)
Re:France Enters the Matrix by eeZah7Ux on Friday February 22, 2019 @05:43AM (#19224371)
Also flexibility can be good but XMPP is way too modular.
Re:France Enters the Matrix by edhelas on Friday February 22, 2019 @05:37PM (#19229786)
You don't have to implement all the modules :p There is some basic ones that you need (see XEP-0412: XMPP Compliance Suites 2019 - https://xmpp.org/extensions/xep-0412.html) and you have already an up to date client and server. The rest if for specific use cases.