Happy to announce a new version of JSJaC, the one and only lib for implementing jabber clients (if it’s about the web ;)). Most notably version 1.2.2 hopefully makes you happy with its new packer (borrowed from mootools) that shrinks down filesize from 71K to 44K. Other changes include bugfixes as well as some issues with licenses and copyright statements being fixed now.
13 Responses to jsjac++
I have users with empty roster that want to chat with each other.
If user A sends a message to user B, how can user B retrieve user’s A nickname or one of his vCard fields? As far as I know only the JID is sent with each one on one chat message.
first off your question is totally unrelated to jsjac. Retrieving a user’s vCard is documented at XEP-0054: http://www.xmpp.org/extensions/xep-0054.html
I may have found an issue with the JSJaCPacket class. The getChild method is inconsistently defined between browsers. In IE, only top-level children are searched, while in other browsers all descendents with the given name (and namespace) are searched. This is because getChild() uses the method getElementsByTagNameNS that does a deeper search and is not defined in IE. The fallback code will be used in IE, does not search below the top-level.
This causes an issue when using digest-based Non-SASL Authentication as described in JEP-0078. The calle to iq.getChild(‘digest’) in _doLegacyAuth2 of JSJaCConnection thus returns null in IE (since the spec defines the iq element contains a query element which then contains the digest element), but returns a valid child in other browsers.
Hi Matt, thanks a lot for this detailed report. Great job! I’ll try to fix this ASAP.
Should be fixed in SVN now
Thanks for the quick turnaround on this! I integrated this change and it worked well.
Thank you for your previous answer.
I have a question regarding your http-bind module. It might not be the place to ask but I couldn’t find the right place.
Do you plan to support the JSON syntax in the future?
Can you explain the steps I’ll need to take to modify your code?
Do you know of utf-8 erlang json implementation?
Mark, if you’re talking about “a GET request” you are not talking about the optional JSON syntax of BOSH (formerly known as HTTP Binding), are you? It’s more about additional requests which go along side to Jabber and HTTP Binding, is it? If yes (the latter), then there’s a problem which arises out of the nature of BOSH: a browser typically is allowed to make 2 concurrent AJAX requests at a maxmimum for the same host and port. BOSH can take up to two concurrent connections. So if you do additional AJAX requests you might run into trouble here.
Nevertheless I wouldn’t recommend to hack this into the ejabberd http-bind module. If you’re using ejabberd2 you could just write your own standalone module which handles such requests. ejabberd2 got a nice pluggable architecture for extending its HTTP capabilities. Have a look at the docs!
Mark, you may want to have a look at yaws’ json code for a fairly well working json implementation. Running ejabberd and yaws simultaneously might be tricky though, but you could simly take the json module as a starting point.
I am talking about the optional JSON syntax of BOSH.
Is it possible?
Mark, sorry for asking again, I wasn’t clear enough in first place: Are you talking about the Alternative Script Syntax as outlined by http://www.xmpp.org/extensions/xep-0124.html#script or about transmitting JSON encode payloads as seen in example 6 at http://www.xmpp.org/extensions/xep-0124.html#stanzas ?
Yes, we are talking about the same thing.
I’m using JabberHTTPBind and JSJac 1.2.2. I can’t get it to open a chat session at all.
In Firefox I get this error:
An error occured:
In IE I get this error:
An error occured:
And Tomcat’s log is saying this:
 sending response : Set the ‘to’ attribute of stream element to the domain part of the user’s JID. Example: to=’gmail.com’.
I’m also getting a lot of these:
[Fatal Error] :1:290: The element type “doc” must be terminated by the matching end-tag “”.
I’ve used the full email and just the first part (i.e. firstname.lastname@example.org and gogo) and neither work.