JavaScript IRC in Instantbird

Published on Saturday, December 4, 2010
Tags: Instantbird, IRC, Mozilla, programming

I’ve been working on rewriting the IRC plugin for Instantbird since the summer (sometime in August, I can’t seem to find the exact date — at least since Sept. 10th though).

Since libpurple (used in Pidgin, Adium, etc.) provides the IRC protocol that we currently use, why do this? One reason is to iron out (and find) some of the bugs left in implementing protocols in JavaScript and part of it is so I can learn to code better. Unfortunately during this semester I was not able to get as much done as I had hoped and almost everything that had been done was finished in August/September

Some big milestones I’ve completed (with dates if I have them):

  1. Connected to server via sockets in JavaScript
  2. Generate a conversation that works as a raw connection to the server (i.e. as if you had opened a telnet connection to the server)
  3. Parsing messages and automatic ponging when the server pings
  4. Joining a channel (2010/12/04, i.e. today!)

There had been a bunch of small bugs I had been having in getting this to work: one error, (which I found quickly) one of the other developers (Florian) was able to help me out with, was that I was not initiating a new object. And after learning a bit above observers I was able to get the UI to respond. I even threw in support for op/half-op/voice After today’s work I was able to generate the following screenshot:

Example conversation using JavaScript IRC.

An initial example of Instantbird communicating using JavaScript IRC.

This build would be almost fully usable by those who do very little on IRC (i.e. if you just want to go and chat, it’d work well), but there’s a lot more work to be done. The code can be viewed in the Experiments repository. (Check it out, there’s a 600+ line switch statement.)