[JDEV] Buddy Icon (Avatar) Proposal
Julian Missig
julian at jabber.org
Thu Aug 30 17:52:38 CDT 2001
The proposal we put together a while ago is available at
http://temas.dyndns.org/~temas/buddy_icons.txt - pasted here for
convenience. Gabber should hopefully support this soon-ish. :)
A simple method to support small buddy icons in Jabber has been an often
requested feature. Here is a proposal that was generated for how this could
be
achieved.
First, the requirements on the image. The image should be a 50 x 50 image
in
either GIF, PNG, or MNG format, as well as under 8k of data. MNG support is
optional.
To let other clients know that you support the buddy icons and have one
available a new x namespace is sent out with the initial presence. If the
user
changes the icon, or disables the icon, a new presence update is sent out
with
the correct information. Examples:
- First login, and user has icon:
<presence>
<x xmlns='jabber:x:avatar'>
<hash>00000000000000000000000000000000000000000</hash>
</x>
</presence>
- User changes their icon:
<presence>
<x xmlns='jabber:x:avatar'>
<hash>1111111111111111111111111111111111111111</hash>
</x>
</presence>
- User disables their icon:
<presence>
<x xmlns='jabber:x:avatar'/>
</presence>
The hash is the SHA1 digest of the icon's data, and is sent so that the
client
can store user images across sessions and not have to request the icon as
often.
The actual icon request is in a new IQ namespace:
- Request the icon:
<iq id='1' type='get' to='user at server/resource'>
<query xmlns='jabber:iq:avatar'/>
</iq>
- Sending the icon:
<iq id='1' type='result' to='user at server/resource'>
<query xmlns='jabber:iq:avatar'>
<data type='gif|png|mng'>
Base64 Encoded Data Here
</data>
</query>
</iq>
More information about the JDev
mailing list