For Developers: Writing IM Plug-ins for Web IMs

We are very pleased to annouce our newly IM plugin API for our potential developers. is providing web IM (instant messenging) services for our users. Currently, the web IM services include web Google Talk (Gtalk), web Windows Live Messenger (MSN), web Yahoo! Messenger (YMsg), AOL Instant Messenger (AIM). More services may be added later.

To illustrate our web IM plugin API, we will develop a plugin to export all contact emails.

The final plugin codes:

javascript:p=new net.izuz.gtalk.MainWindow.IMPluginAdapter();p.dealRoster=function(w, e){log(;return false;}; net.izuz.gtalk.MainWindow.addIMPlugin(p);

How to use this web IM plugin

  1. Logout your web IM
  2. Copy the above line of codes (in fact, it is a link), and paste it into the browser’s address bar and press <Enter> to run the JavaScript code
  3. Login your web IM
  4. After all your contacts are listed, there will be a new link anchor generated inside the page named “Open System Console”. Click it will bring you a window with all your contacts’ email.
    If you can not find the link, copy
    And paste it into address bar and <Enter> will also bring you a window with all your contacts’ email.

IM Plugin Development Details

In fact, the above plugin contains following lines:

var plugin = new net.izuz.gtalk.MainWindow.IMPluginAdapter ();
plugin.dealRoster = function (mw, evt) {
log (;
return false;
net.izuz.gtalk.MainWindow.addIMPlugin (plugin);

First, all plugins should be an instance of net.izuz.gtalk.MainWindow.IMPluginAdapter. Here is the its Java source (You are not required as a Java expert. But we think giving its source will help you to get a better understanding) :

public static class IMPluginAdapter implements IMPluginable {
public boolean dealLogin(MainWindow mw, DuplicateLoginEvent dle) {
return false;
public boolean dealTyping(MainWindow mw, TypingEvent ts) {
return false;
public boolean dealMessage(MainWindow mw, MessageEvent ms) {
return false;
public boolean dealRoster(MainWindow mw, RosterEvent rs) {
return false;

And you can override its methods to fulfill your job. The above plugin overrides its dealRoster method, which is about contacts’ information. To override a method using JavaScript is quite an easy job:

plugin.dealRoster = function (mw, evt) {
log (;
return false;

In the above codes, we use log() method to print email into console window. log() method is provided by Java2Script core library. For more information about Java2Script, please visit .

And finally, you add the plugin to our web IM system by net.izuz.gtalk.MainWindow.addIMPlugin (plugin); And you can remove it later by net.izuz.gtalk.MainWindow.removeIMPlugin(plugin);

More about IMPluginAdapter’s Method

net.izuz.gtalk.MainWindow.IMPluginAdapter.dealLogin(MainWindow, DuplicateLoginEvent)
net.izuz.gtalk.MainWindow.IMPluginAdapter.dealMessage(MainWindow, MessageEvent)
net.izuz.gtalk.MainWindow.IMPluginAdapter.dealRoster(MainWindow, RosterEvent)
net.izuz.gtalk.MainWindow.IMPluginAdapter.dealTyping(MainWindow, TypingEvent)

These methods all have two parameters. The first parameter is the messenger window itself. You can do anything you want by using this MainWindow object. We will provide more information this instance in later articles.

The second parameter is about data passing back from web IM servers. There are four events. Here are their data structures:

iz.z.event.DuplicateLoginEvent.beQuiet // always be true, if there is such a event

iz.z.event.MessageEvent.body // message in plain text
iz.z.event.MessageEvent.from // email of sender
iz.z.event.MessageEvent.thread // an ID to mark the chatting session // email of receiver

iz.z.event.RosterEvent.avatar // user’s avatar picture hash
iz.z.event.RosterEvent.confirmed // already a registered user or not
iz.z.event.RosterEvent.mode // available, away, idle, busy, offline
iz.z.event.RosterEvent.status // customized status message

iz.z.event.TypingEvent.from // email of sender
iz.z.event.TypingEvent.typing // is typing or not

So, you already can develop some interesting plug-ins to collect your messages and your contacts information.

We would like to hear your feedback for more APIs.

This entry was posted in Developer and tagged , , , . Bookmark the permalink.

7 Responses to For Developers: Writing IM Plug-ins for Web IMs

  1. Pingback: I talk U talk » Blog Archive » I Have an IM Agent

  2. Samuel L. says:

    If you want to read a reader’s feedback 🙂 , I rate this post for 4/5. Detailed info, but I just have to go to that damn msn to find the missed parts. Thanks, anyway!

  3. How can added this on the HTML pages

  4. WeBuzz says:

    @Jessica herry
    Is this page
    what you are looking for ?

  5. rishi says:

    I have developed the code for video chatting and implementing for conferencing.I want to make it open source.If you want to make use of this then you can make it.

  6. WeBuzz says:

    Nice to hear that. Does your video chatting compatible with Gtalk/MSN/Yahoo/AIM ?

  7. Very Nice website. I built mine and i was looking for some ideas as well as your website provided some. May i ask you whether you developed the web site by youself?

Leave a Reply

Your email address will not be published. Required fields are marked *