diff --git a/source/org/jivesoftware/smackx/packet/VCard.java b/source/org/jivesoftware/smackx/packet/VCard.java index 9766db824..70d2d59fa 100644 --- a/source/org/jivesoftware/smackx/packet/VCard.java +++ b/source/org/jivesoftware/smackx/packet/VCard.java @@ -85,7 +85,8 @@ import org.jivesoftware.smack.util.StringUtils; * @author Kirill Maximov (kir@maxkir.com) */ public class VCard extends IQ { - + private static final String DEFAULT_MIME_TYPE = "image/jpeg"; + /** * Phone types: * VOICE?, FAX?, PAGER?, MSG?, CELL?, VIDEO?, BBS?, MODEM?, ISDN?, PCS?, PREF? @@ -93,7 +94,6 @@ public class VCard extends IQ { private Map homePhones = new HashMap(); private Map workPhones = new HashMap(); - /** * Address types: * POSTAL?, PARCEL?, (DOM | INTL)?, PREF?, POBOX?, EXTADR?, STREET?, LOCALITY?, @@ -357,7 +357,7 @@ public class VCard extends IQ { * @param bytes the bytes of the avatar, or null to remove the avatar data */ public void setAvatar(byte[] bytes) { - setAvatar(bytes, "image/jpeg"); + setAvatar(bytes, DEFAULT_MIME_TYPE); } /** @@ -390,6 +390,16 @@ public class VCard extends IQ { photoMimeType = mimeType; } + /** + * Set the encoded avatar string. This is used by the provider. + * + * @param encodedAvatar the encoded avatar string. + * @deprecated Use {@link #setAvatar(String, String)} instead. + */ + public void setEncodedImage(String encodedAvatar) { + setAvatar(encodedAvatar, DEFAULT_MIME_TYPE); + } + /** * Return the byte representation of the avatar(if one exists), otherwise returns null if * no avatar could be found.