The last two weeks I've been programming mostly in Go. The language, I think, feels a lot like Python would if it had been re-designed by an old C programmer. I got productive rather quickly and it feels very much at home. I'll probably write something about my experience later.

I've been mostly happy with emacs-jabber as my XMPP chat client for the last few years but as more and more of my contacts move to mandatory use of OTR encryption it leaves something to be desired. There's Magnus' jabber-otr which uses a pure-Python OTR implementation under the hood, but it's rather fragile and very much a work in progress.

Linus Nordberg pointed me to Adam "agl" Langley's xmpp-client a couple of months ago. It's a minimalist command line XMPP chat client written in Go with excellent OTR support. I started using it, but missed emacs-jabber a bit.

When I started learning Go two weeks ago I had an idea that I would do an Emacs frontend to xmpp-client and get back some of the emacs-jabber goodness. My idea was that, if the current user interface in xmpp-client was isolated from the functionality, I could write my own user interface code, specifically meant to be easy to parse from Emacs Lisp.

I delved into the code, but found that the terminal user interface is sprinkled all over xmpp-client together with the code that defines its function as a chat client. This means that if I go this way I would either have to reproduce a lot of the chat client functionality in my code or, probably better, do a lot of work to isolate the UI code.

While I was in the xmpp-client code I decided to at least make it nicer for me to use. I added a few commands and a new configuration item. My changes so far:

  • /whois command. Gives information about a user, their current state online/offline away/chatty/xa/dnd and if we have a current OTR session.

  • /who command. Lists online users in a short form. This ties in to the next feature.

  • InitialAwayIsOnline, a new configuration item. If true it means people in our roster which are initially marked as "away" are considered online as far as /who is concerned. If set to false, those people are not listed. This is the default and the same as the old behaviour.

  • /m command. Like /query in most IRC clients. Sets the default target we're chatting with. Also prints some data about our target: are they even online? Do we have an OTR encryption session? Are their identities verified?

Code here:

All features merged in master branch. Each future is on a similarly named topic branch. InitialAwayIsOnline is on the "who" branch.