You are currently viewing a snapshot of www.mozilla.org taken on April 21, 2008. Most of this content is highly out of date (some pages haven't been updated since the project began in 1998) and exists for historical purposes only. If there are any pages on this archive site that you think should be added back to www.mozilla.org, please file a bug.



Staring an IM from the Addressbook
Seth Spitzer

There are two ways to start an IM from the addressbook
  1. clicking on the IM presence icon in the card pane
  2. using the IM button in the toolbar
We start the IMs and chats by running the appropriate goim: url.

For the IM presence icon in the card pane, we run an url like aim:goim?screenname=foo
That should open an IM window to "foo", or if one is open, raise it.

We only show the presence icon if the user is online, and there is a screenname specified for the current card.
For more on how we determine presence, see this document.

For the IM button, the action is based on the screennames of the cards selected in the results pane.
(Not all card will have screennames.)

If the total number of screennames for the selected cards is 0, we run the url aim:goim
That should open a blank IM window, or if one is open, raise it.

If the total number of screennames for the selected cards is 1, we run an url like aim:goim?screenname=foo
That should open an IM window to "foo", or if one is open, raise it.

If the total number of screenames for the selected cards is 2 or more, we run an url like
aim:SendChatInvite?listofscreennames=foo,bar,cheese&message=Join+me+in+this+chat
That should open an chat invitation to foo, bar and cheese.

The string ("Join+me+in+this+chat") is localized into addressBook.properties.

If you are using Netscape 7.x, it will use the internal AIM client.
If you are using Mozilla, it will use the default AIM client (what ever registers as the handler for the aim: scheme)

Notes:
  1. Not all platforms will launch the default aim client [link to known bugs]
  2. There is a bug to make the url configurable so that applications other than AIM can use it.
References:

[1] http://lxr.mozilla.org/mozilla/source/mailnews/addrbook/resources/content/addressbook.js#705
[2] http://lxr.mozilla.org/mozilla/source/mailnews/addrbook/resources/locale/en-US/addressBook.properties#110
[3] addressbook UI spec