Monday, August 1, 2011

XMPP: The infinite messaging protocol

It has been a while since my last post, and I have been extremely busy. There are no shortage of projects to waste time on, and today I'll be talking about one of them. Since a screenshot is best, let's start off with one:

This is a chat client that has been co-developed by Iván Briano (Sachiel) and me over the past month or so. It is still in the very early stages of work in terms of its UI, but it is very usable.
Above you can see a screenshot of the client's contact list window and an empty chat window. The open menu is an early implementation of the status menu, and it allows the user to set the status of the account. The other component of the status menu is the status entry, which allows the user to set status messages; it can be seen at the bottom of the contacts list window.


This is another feature in development which uses a very unfinished Elementary widget called "gengrid." This widget allows a developer to autogenerate a grid view of objects. This view is toggled from a menu, and can be switched to at any time. As I mentioned, this widget is not very polished, and so it does not look as good as the list view :)


Here we see a shot of the chat window, where I am in a deep conversation with Leif Middelshulte (T_UNIX). Since XMPP allows its clients to connect multiple "resources" (devices) to the same account, this client allows for users to determine exactly which resource, or all of them, will receive messages. By default, it will abide by the priority value set by other users' clients, but if I click on this radio button in the menu, Leif will suddenly be receiving a lot of SMS on his phone!

One of the biggest strengths of the EFL is its integration with media. This next shot showcases what is, IMO, the best feature that this client offers:

Any time an image is linked in conversation, its URL is automatically parsed. This URL is then downloaded and cached to be made available as a tooltip on mouseover of the address, as seen above. Any images downloaded using this mechanism are automatically saved to disk using their SHA1 hash, preventing them from being downloaded again in the future and saving bandwidth. We hope to provide similar effects for other types of media as well!

One might ask what libraries I have used to power this client. The following is a list of all components involved:
Non-EFL technologies
  • The insanely fast PugiXML parser. I use this in all of my projects involving XML because of its amazing speed, concise API, and very friendly+helpful author :)


  • LibB64. If it uses base64 encoding, you'd better be using this or you're just wasting memory and CPU cycles.


  • EFL
  • ECORE: The networking API here makes connecting to XMPP servers a snap, and it also handles the STARTTLS mechanism of the protocol with ease.


  • Elementary: The EFL widget toolkit. Despite being under heavy development and containing lots of potentially unwanted "features," ELM still packs a punch and gives the developer a lot of freedom and control over how an app looks, feels, and acts.



  • This client is not yet available in the public E svn repository, but it is LGPL licensed and will be moved there once it is ready for public use. Keep your eyes peeled!