Thursday, April 18, 2002
hypothetic.org

Jabber Emoticons

A proposal for implementing emoticons in Jabber.

Objective

The objective of proposal is to explain how emoticons should be used in the Jabber protocol.

Basic Explanation

This emoticon system uses XHTML Basic to send emoticons. Emoticons are sent as <img/> tags withing the XHTML body. The tag should contain the height and width of the emoticon, and most will probably be 16x16. The src attribute of the tag will be the URL of the image of the emoticon. There will be a standard list of emoticons that supporting clients can cache so they do not have to download the image every time. The alt attribute of the tag will contain an ASCII version of the emoticon. If the client receiving the message with an emoticon does not support XHTML, the client sending the message will already be aware since it browsed the client. In this case, it will just send a regular message with the ASCII equivalent of the emoticon in the <body/>.

XML Examples

Below is an example of a message sent to a client supporting XHTML.

  <message>
    <html xmlns="http://www.w3.org/1999/xhtml">
      <body>
        I am <img src="http://emoticons.jabber.org/3/smile.png" alt=":-)" width="16" height="16" /> because I have <img src="http://emoticons.jabber.org/3/beer.png" alt="[beer]" width="16" height="16" />.
      </body>
    </html>
  </message>

Below is an example of the same message sent to a client not supporting XHTML.

  <message>
    <body>
      I am :-) because I have [beer].
    </body>
  </message>

Caching

Ideally, there will be a standard set of emoticons in a central place. These will all have valid URL's, and should be downloadable as a set by client developers. Clients will map URL's to cached emoticons so they do not have to download the image every time an emoticon is used. This set should have an easy way of updating to a new version, and when that happens, clients will update themselves with the new set. For example, the emoticon sets might be on http://emoticons.jabber.org/, and the first set would be in http://emoticons.jabber.org/1/. If the set of emoticons is updated, the new set will be at /2/, and /1/ will still be online for clients that still send those emoticons. Substantial time should be given to client developers to update their cache for their next version so that there are not too many clients still stuck using the old sets.

Advantages Over Plaintext Emoticons

Plaintext emoticons are those that clients parse strings such as :-) and (B) out of the <body>'s of messages.

Copyright ©2002 to Mike Mintz.