0
votes

I'm creating (yet another) mobile chat app, using Smack and ejabberd. I'm trying to ascertain the best way to implement user avatars for use in multi-user chat rooms, and also of course for roster members. Looking at possible solutions, I can see:

  1. XEP-0008 IQ based avatars - avatars are limited to 64 by 64 pixels, too small.
  2. XEP-0153 vCard based avatars - Easy to implement for both users in the roster and MUC rooms, however (a) sources such as this seem to indicate that one's own vcard needs to be downloaded on every login (is this strictly true? I can't see this in the specs), and (b) should be less than 96 by 96 pixels (still pretty small)
  3. XEP-0084 User Avatar based on Personal Eventing Protocol - I'm not clear how I can retrieve avatars for all users in a multi-user chat room based on this protocol. After joining the chat room, I would need to subscribe to the metadata node of all users, and any subsequently joining users? And also unsubscribe when they leave the room? I figure this would be pretty ugly and clumsy to implement.

Can someone kindly point me in the right direction, or indicate where I may have misunderstood? Thanks.

1
Have you tried XEP-0054 ? - souvickcse
Thanks @souvickcse, I understand that XEP-0153 is built on top of XEP-0054. However, I see that I could utilize BINVAL and EXTVAL fields of the vCard in XEP-0053 to store image data or a URI to an image. Some questions: 1.is there practical or theoretical limits to the size of data we can store in BINVAL? I can't see any in the spec 2: Does the user's own vCard need to be reloaded on each login? Is this just a requirement to ensure synchronisation across clients? 3. Is there a way to achieve this using one of the existing XMPP avatar specs (such that is is standard and cross-compatible)? - Dave
Hi i don't have that much of idea(sorry about that) i have used this in one of my project using using github.com/robbiehanson/XMPPFramework Code : NSData *photoData = [[[AppDelegate delegate] xmppvCardAvatarModule] photoDataForJID:user.jid]; - souvickcse

1 Answers

0
votes

I guess the best way to address this issue may be to store/load the images Out of band via a HTTP server. Images could be stored with a filename such as "username_imagehash.xxx". For users not in one's roster (eg strangers in a multi-user chat), we pull their avatar via a URI retrieved from their vCard PHOTO field. Each time a stranger is re/encountered, we reload their vCard, and can identify the need to redownload their photo via a change in the URI in the vCard.

Once the user is added to one's roster, we subscribe to their avatar updates via XEP-0084, publishing the same URI (see example 4. in XEP-0084).

I think this addresses all requirements, I will find out once I've implemented. I can understand that it is not done this way in standard XMPP clients as it depends on an HTTP server separate to the XMPP service (and need to handle HTTP server security - user authorization/authentication).

Feedback welcome!