Jitsi (http://jitsi.org) has recently implemented a functionality to remove the current avatar using vCard (cf. XEP0153). This requires to send a vCard with an empty “photo” tag, which leads us to modify the behavior of the “setAvatar” function of the smack “VCard” class.
These modifications correspond to the attached patch, that we would like to push upstream to the smack library.
This patch induces the following behaviors when calling vCard setAvatar(byte bytes) or setAvatar(byte bytes, String mimeType):
If “bytes” is null, then no “photo” tag is included in the vCard.
If “bytes” is non-null but with a length equal to zero, then an empty “photo” tag is included in the vCard.
If “bytes” is non-null but with a length greater than zero, then a “photo” tag containing a “type” and a “binval” tags is included in the vCard.
Vincent Lucas, Ph.D. Jitsi developer