hannesm / jackline

minimalistic secure XMPP client in OCaml
BSD 2-Clause "Simplified" License
250 stars 20 forks source link

XML stanza issue: /remove rejected by prosody (and maybe other servers) #116

Open infinity0 opened 8 years ago

infinity0 commented 8 years ago

When trying to remove someone from my roster, I'm getting the following:

[17:23:54] OUT TLS: <iq type='set' id='8'><query xmlns='jabber:iq:roster'><item subscription='remove' jid='lol@pwned.gg' xmlns=''/></query></iq>
[17:23:54] IN TLS: <iq id='8' type='error' to='infinity0@pwned.gg/xxxx'><error type='modify'><bad-request xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/></error></iq>

I'm not sure if this is a server bug (I'm using prosody 0.9.4) but it would be good if jackline notified the user that the server sent the error reply.

https://xmpp.org/rfcs/rfc3921.html#int-remove for reference

infinity0 commented 8 years ago

Still fails with prosody 0.9.7. BTW, this is what pidgin sends:

(19:36:12) jabber: Sending (ssl) (infinity0@pwned.gg/main-laptop): <iq type='set' id='purple9ed7e6c0'><query xmlns='jabber:iq:roster'><item jid='lol@pwned.gg' subscription='remove'/></query></iq>
(19:36:12) jabber: Recv (ssl)(203): <iq id='purple9ed7e6c0' type='result' to='infinity0@pwned.gg/main-laptop'/><iq id='lx13' type='set'><query ver='457' xmlns='jabber:iq:roster'><item jid='lol@pwned.gg' subscription='remove'/></query></iq>

and it works. Probably you should set id= on the iq stanza. Looks like the difference is that you have an empty xmlns='' in the item stanza and that's probably what messes things up for prosody.

hannesm commented 8 years ago

thanks for your investigation. I should fix the error reporting soon, removing the xmlns='' will take some more time (I plan to switch the underlying xml library). please bear with me, this is my spare time project.

hannesm commented 8 years ago

the error is now reported in the user interface... will leave this open until I fix the actual issue (get /remove working with prosody)