0

I'm trying to set the PHOTO vCard attribute with an URI provided by our backend, according to the xep-0054,

<!-- Photograph property. Value is either a BASE64 encoded
binary value or a URI to the external content. -->
<!ELEMENT PHOTO ((TYPE, BINVAL) | EXTVAL)>

I'm using ejabberdctl with the mod_admin_extra extension.

ejabberdctl set_vcard foo chat.myjabber.com PHOTO http://link_to_image.jpg
ejabberdctl set_vcard2 foo chat.myjabber.com PHOTO EXTVAL http://link_to_image.jpg

But doesn't seems to work, I see nothing in pidgin & psy (value is correctly saved in database)

I'm running Archlinux, Pidgin 2.10.6 (libpurple 2.10.6) & ejabberd 2.1.11

m4tm4t
  • 2,361
  • 1
  • 21
  • 37
  • I'm running ejabberd 2.1.5-6 (centos 5.3) and pidgin 2.10.0 (fedora 14), doesn't appear to be working for me either. I have users that are using Ubuntu's Empathy and their avatars show up in pidgin. I'm not familiar with how Empathy is setting their xmpp avatars. – slm Jan 13 '13 at 12:16
  • With what set_vcard syntax your users see URI based avatars ? Because client based are shared with pub/sub – m4tm4t Jan 13 '13 at 12:42
  • That's just it. I can't tell how they're doing it. When I run `get info` from pidgin it shows the image as `Photo:` in the dialog, but it does that if I use pidgin to set a buddy icon too. I'm assuming Empathy is utilizing vcard for that, but not entirely sure. – slm Jan 13 '13 at 12:48

1 Answers1

1

I asked on https://github.com/processone/ejabberd/issues/47 and most of popular client doesn't support EXTVAL

xep-0054 is in contradiction of the xep-0153 that say

4.5 XML Syntax

The following rules apply to the XML syntax:

The <PHOTO/> element SHOULD contain a <BINVAL/> child whose XML character data is Base64-encoded data for the avatar image.

The <PHOTO/> element SHOULD NOT contain an <EXTVAL/> that points to a URI for the image file.

The <PHOTO/> element MUST NOT contain the avatar image itself.

The <PHOTO/> element SHOULD contain a <TYPE/> child whose XML character data specifies the content-type of the image data. The XML character data SHOULD be "image/gif", "image/jpeg", or "image/png".

The <PHOTO/> element MUST NOT possess a 'mime-type' attribute.
m4tm4t
  • 2,361
  • 1
  • 21
  • 37
  • I asked a similar question over on ejabberd's process-one forum and haven't gotten a response. http://www.process-one.net/en/forum/viewthread/753/. Glad someone shed some light on this. – slm Jan 15 '13 at 14:55
  • Did anyone indicate a time frame that this might get fixed/implemented? – slm Jan 15 '13 at 14:59
  • 1
    I think this question should be asked to the client(s) dev's. I have see facebook had a workaround some years ago for avatar URI's, but now I see avatars as BINVAL. – m4tm4t Jan 15 '13 at 15:06
  • Do you know how to set the image using BINVAL instead of EXTVAL? Is it just changing the argument to ejabberdctl? If so I could whip up a cronjob that would see that a vcard has a URL, wget that URL, encode it in bin64, and write that to ejabberdctl calling the BINVAL command. Wouldn't take much time. – slm Jan 15 '13 at 15:12
  • Yes the process is ugly, we have to run a script that download the avatar, then extract the MIME type, then encode as base64 and finally save it through ejabberdctl. I personally moved avatar vcard at the end of our todolist. – m4tm4t Jan 15 '13 at 15:17
  • OK so you have a solution? You should share your solution/workaround for now on this question. I maintain a ejabberd server as well and hadn't implemented this feature but my interest was peaked by your question and would like to implement this capability now. – slm Jan 15 '13 at 15:28
  • At this time no. This is a client behavior, we have to ask pidgin, gajim etc... developers why EXTVAL is not supported. Be sure I will update this question if I found something new. – m4tm4t Jan 15 '13 at 15:39