GSoC 2007: Week One
Despite my laptop’s treachery (and this CRT’s attempts to boil my eyes), things are going well.
I’ve written bots for testing XEPs 201 (Best Practices for Message Threads) and 155 (Stanza Session Negotiation). I’ve also coaxed Gajim into negotiating a session from start to finish (assuming it’s been initiated by some other party).

A lot of my time has been spent figuring out the best way to implement sessions (and fit them into Gajim’s existing structure). All of the XMPP client libraries I’ve seen focus on individual stanzas and the connection to the server. Once you need to keep track of the state of an interaction with another client, things become messy.
The solution is to add another layer between the server session and the stanza handlers. Rather than having a single client that handles everything, you have a generic client that dispatches messages to sessions that handle everything. Even if you’re not implementing anything that depends on stanza sessions, I think it’s a good idea; you can let the session worry about who to send stanzas to, and I think it more closely models the typical useage.
I’ve already rewritten my bots to use this scheme, and cut out a good 25% of their code in doing so. I’m in the process of trying to do something similar with Gajim. The complications of retrofitting existing clients with sessions are going to be a problem for ESessions (and myself, for that matter.)
(By the way, the bots are not up and running right now; they need better error handling before I unleash the public on them.)