Jabber user profile vCard-base Avatar JEP-0153

Source: Internet
Author: User
Tags vcard
Jabber user profile picture save another method vCard-base Avatar JEP-0153
This method is used by PSI, except for Versions later than 0.11.
Disadvantage: It is bound with the vCard information. Each time a large amount of content is updated, additional redundant information needs to be added each time in the Presence broadcast.
Advantage: the server is easy to implement without additional programming.

Procedure:

How to save the Avatar: Add a photo label to the vCard
<IQ from = 'timyang @ jabber.org'
Type = 'set'
Id = 'vc1 '>
<VCard xmlns = 'vcard-Temp '>
<Bday> 1476-06-09 </bday>
<ADR>
<Ctry> Italy </ctry>
<Locality> Verona </locality>
<Home/>
</ADR>
<Nickname/>
<N> <given> Tim </given> <family> Yang </family> </n>
<Email> jcapulet@shakespeare.lit </Email>
<Photo>
<Type> image/JPEG </type>
<Binval>
Base64-encoded-avatar-file-here!
</Binval>
</Photo>
</VCard>
</IQ>

Add Avatar information to user broadcast <presence>.

<Presence from = 'timyang @ jabber.org/balcony'>
<X xmlns = 'vcard-Temp: X: Update'>
<Photo> sha1-hash-of-image </photo>
</X>
</Presence>

A friend can query the vCard by obtaining the user's avatar information:
<IQ from = 'Romeo @ montague.net/orchard'
To = 'timyang @ jabber.org'
Type = 'get'
Id = 'vc2 '>
<VCard xmlns = 'vcard-Temp '/>
</IQ>

Server Returns vCard on behalf of user
<IQ from = 'timyang @ jabber.org'
To = 'Romeo @ montague.net/orchard'
Type = 'result'
Id = 'vc2 '>
<VCard xmlns = 'vcard-Temp '>
<Bday> 1476-06-09 </bday>
<ADR>
<Ctry> Italy </ctry>
<Locality> Verona </locality>
<Home/>
</ADR>
<Nickname/>
<N> <given> Juliet </given> <family> Capulet </family> </n>
<Email> jcapulet@shakespeare.lit </Email>
<Photo>
<Type> image/JPEG </type>
<Binval>
Base64-encoded-avatar-file-here!
</Binval>
</Photo>
</VCard>
</IQ>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.