Telepathic Flirt With Chromium

Hackweek is an event in SUSE where developers can work on any pet project for a week (like Google's 20%) This year's edition happened last week in SUSE. Since I am part of the openSUSE community, I too participated in the spirit of this event in my night time. The project is codenamed Arattai.

I tried to bring a prototype to provide IM/Chat support built-in to the Chromium browser. Watch the screencast below. Please click here in case you do not see the embedded video. Please see the video in full screen HD.



Under the Hood

  • I have used Telepathy  as the underlying library for implementing the basic chat support. 
  • The source code is mostly a prototype which will have to go through a rigorous design review and improved upon if you need to use it in a production machine. This is mostly to satisfy a personal itch and not of good quality yet.
  • The patches are attached in the Chromium bug http://code.google.com/p/chromium/issues/detail?id=98990
  • I chose Telepathy because it seem to provide the best implementation for XMPP 0174 protocol, Serverless Messaging, which was my primary aim. Also it is agreed upon by both GNOME and KDE. Isn't it something rare ;-) ?
  • The heart of the code is only about 5 days old and is not of good quality yet. 
  • telepathy-glib has a C interface. Chromium is written using C++ . So, I wrote a TelepathyBridge class with static members to marshal the requests from Chromium to Telepathy and vice-versa. I wrote a TelepathyBean class to move across these layers. Also, there were ArattaiUI and ArattaiHandler classes to take care of the Chromium side of things (like registering a protocol, webui etc.) The user-interface you have seen is provided by the arattai.html and arattai.js files.
  • I believe having IM support may be important for Chromium as IM is one of the important activities that could not be performed yet on the browser.
  • There are things like webRTC which will form the future of communication. However, we still have dozens of protocols that work with existing clients which the browser should support (like support for Novell Groupwise, MSN, Office Communicator etc.)

Observations
  • My personal opinion that, C++ is a needlessly complex language, strengthened. There are a dozen ways to do casting, smart pointers, const functions etc. but no native async/event support. I love C# as a programming language. Sadly C# does not seem to have an appealing future on Linux anymore.
  • The guy who invented Javascript should have been a C++ programmer.
  • Javascript typing can get on a C programmer's nerves
  • Telepathy hackers in #telepathy are extremely helpful. Thanks a lot folks.
  • Open source libraries in general have very poor documentation, if not backed by a company like Google.
  • If Telepathy support has to be included into Chromium, it should be available in Windows too.
  • Automatic memory management is bliss.
Please share your opinions/thoughts about this feature either in the comments or by mail. Thanks.