From 58f56ee31b11eb8eaf3a5afd42b61b2b94273926 Mon Sep 17 00:00:00 2001 From: rcollier Date: Sun, 24 Mar 2013 15:02:25 +0000 Subject: [PATCH] SMACK-413 Put removed public method back in and marked as deprecated. We can remove in major release. git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/branches/smack_3_3_0@13592 b35dd754-fafc-0310-a699-88a17e54d16e --- source/org/jivesoftware/smackx/packet/VCard.java | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) 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.