[ejabberd] Retrieve avatar from ejabberd

Pedro Melo melo at simplicidade.org
Wed Sep 5 20:12:03 MSD 2007


Hi,

On Sep 5, 2007, at 3:49 PM, mitcheloc wrote:

> Hello all, How would I go about this:
>
> I'd like to retrieve the avatar for a jabber user from ejabberd and
> display it on a web page. Using an image tag such as:
>
> <img src="http://jabber.server.com/avatars/?jid=test@jabber.org />
>
> I'll probably need a php script to generate the image. I'm wondering
> specifically how to effeciently pull the data out of ejabberd?
>
> Ideally, I'd like to retrieve avatars for users on other domains (thus
> on xmpp servers not controlled by me) but I'll settle for just
> retreiving Avatars for local users.

What you can do is:

  . create a component that receives a copy of each presence,  
incoming and outgoing;
  . look for the tell tale   <x xmlns='vcard- 
temp:x:update'><photo>sha1-hash-of-image</photo></x>
  . if hash is not present in your local disk, fetch it with XEP-0054;
  . associate JID from presence to hash of photo.

Things you need to have, and someone else might know how to get from  
ejabberd: a copy of all your incoming and outgoing presences.

Best regards,
-- 
Pedro Melo
Blog: http://www.simplicidade.org/notes/
XMPP ID: melo at simplicidade.org
Use XMPP!




More information about the ejabberd mailing list