Search in sources :

Example 1 with VCardUpdateExtension

use of org.jivesoftware.sparkimpl.profile.ext.VCardUpdateExtension in project Spark by igniterealtime.

the class ContactItem method setPresence.

/**
 * Sets the current presence on this contact item.
 *
 * @param presence the presence.
 */
public void setPresence(Presence presence) {
    this.presence = presence;
    final VCardUpdateExtension extension = presence.getExtension("x", "vcard-temp:x:update");
    // Handle vCard update packet.
    if (extension != null) {
        String hash = extension.getPhotoHash();
        if (hash != null) {
            this.hash = hash;
            if (!hashExists(hash)) {
                updateAvatar();
                updateAvatarInSideIcon();
            }
        }
    }
    updatePresenceIcon(presence);
}
Also used : VCardUpdateExtension(org.jivesoftware.sparkimpl.profile.ext.VCardUpdateExtension)

Aggregations

VCardUpdateExtension (org.jivesoftware.sparkimpl.profile.ext.VCardUpdateExtension)1