Tag Archives: XMPP

Glou WoC Week 3 – Handle my Stanza

This report is released weekly within the scope of the Glou Winter of Code.

The starter for last week was XmlElem obtaining a list of children and a link to its parent. That also means get_string of XmlElem now delivers the complete XML string inclusive the children’s content. After that it was all about XML namespaces. First XmlElem and XmlAttr have been a bit reshaped to properly support namespaces. XmlNsDecl was introduced; it represents namespace declarations in XML elements. By looking through those declarations one can find a so-called namespace scope which maps element and attribute prefixes to their actual namespaces. All XML stringify functions now use those namespace scopes to properly resolve prefixes for elements and attributes. The good thing here is that the whole namespace handling and prefix resolving is done transparently. So one more thing libxoup users won’t have to care about.

After that groundwork was done it was time to touch the XMPP / stanza handling code again. The XMPP handler tree had to yield for a simpler and more convinient approach. Now one globally can register a StanzaHandler, which then, on initialization, sets up triggers for every XML element (children of XMPP stanzas) it wants to handle. Those triggers will fire whenever such a specified element occures in the stream. In most cases the handling of a stanza will result in some event that’ll spit out some object (e.g. a MessageReceivedEvent which will deliver a Message object). In consequence StanzaHandlers are now also able to provide a serialize method which takes a Stanza object and then converts it into bits and bytes ready to be sent over the network.

Next to the above mentioned stuff a few minor things were also accomplished. Some more utility methods made it into the code and some bugs were fixed. Also, on top of the new XMPP / stanza handling, the implementation of XMPP resource binding has been started. All in all I would say we are looking back at a productive week :) .

This week the focus is on testing (mostly the code that was implemented during the last week), on polishing, fixing bugs, completing the examples and adding more documentation. Also the release of libxoup 0.1 is planned to happen this week. After that, if there is time left, the integration of libxoup into the existing parts of libglou will be prepared.

That’s it everyone. See you again, as always, next week on monday. Have a nice week.
- Sven

Glou WoC Week 2 – XMPP Streams

This report is released weekly within the scope of the Glou Winter of Code.

Another week passed that brought libxoup one step nearer to its first release. First of all the XoupXmppConnection obtained its backend, XoupConnection. The next step was to implement XoupXmppServer, which listens for incoming XoupXmppConnections. That means a XoupXmppConnection can now receive its data from the network, and hasn’t to be fed by hand anymore. Then there was time to concentrate on the main task of the week, the handling of XMPP streams (which basically means handling the XMPP <stream> element). After the XoupXmlElem was a bit enhanced with stringify functionality, XoupXmppStreamHandler was added which is responsible for stream handling according to the XMPP standard. As result establishing XMPP streams works now.

Besides the stream handling, the test system was updated. Every testcase is now compiled to an own executable, which makes testing easier as it is more stable against segfaults and other such nasty things. Furthermore a roadmap had been worked out that outlines the goals and the timeline for the first milestone of Glou.

For this week, the main goal is to implement stanza handling, i.e. parsing XMPP stanza elements (message, presence, iq) and emitting events when a stanza is received.  The second task is to enhance the XoupXmppStreamHandler with some better namespace and error handling. Those are pretty much the last blockers for the libxoup release.

That’s it for the report of week 2. Read you next week :) .

- Sven