mirror of
https://github.com/igniterealtime/Spark.git
synced 2025-12-01 12:27:58 +00:00
Update VCardManager.
git-svn-id: http://svn.igniterealtime.org/svn/repos/spark/trunk@9066 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
@ -39,13 +39,6 @@ import org.xmlpull.mxp1.MXParser;
|
|||||||
import org.xmlpull.v1.XmlPullParser;
|
import org.xmlpull.v1.XmlPullParser;
|
||||||
import org.xmlpull.v1.XmlPullParserException;
|
import org.xmlpull.v1.XmlPullParserException;
|
||||||
|
|
||||||
import javax.imageio.ImageIO;
|
|
||||||
import javax.swing.ImageIcon;
|
|
||||||
import javax.swing.JComponent;
|
|
||||||
import javax.swing.JMenu;
|
|
||||||
import javax.swing.JMenuItem;
|
|
||||||
import javax.swing.JOptionPane;
|
|
||||||
|
|
||||||
import java.awt.Image;
|
import java.awt.Image;
|
||||||
import java.awt.event.ActionEvent;
|
import java.awt.event.ActionEvent;
|
||||||
import java.awt.event.ActionListener;
|
import java.awt.event.ActionListener;
|
||||||
@ -64,6 +57,13 @@ import java.util.HashMap;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.concurrent.LinkedBlockingQueue;
|
import java.util.concurrent.LinkedBlockingQueue;
|
||||||
|
|
||||||
|
import javax.imageio.ImageIO;
|
||||||
|
import javax.swing.ImageIcon;
|
||||||
|
import javax.swing.JComponent;
|
||||||
|
import javax.swing.JMenu;
|
||||||
|
import javax.swing.JMenuItem;
|
||||||
|
import javax.swing.JOptionPane;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* VCardManager handles all VCard loading/caching within Spark.
|
* VCardManager handles all VCard loading/caching within Spark.
|
||||||
*
|
*
|
||||||
@ -132,16 +132,17 @@ public class VCardManager {
|
|||||||
newPresence.removeExtension(jabberExt);
|
newPresence.removeExtension(jabberExt);
|
||||||
}
|
}
|
||||||
|
|
||||||
byte[] bytes = getVCard().getAvatar();
|
if (personalVCard != null) {
|
||||||
if (bytes != null) {
|
byte[] bytes = personalVCard.getAvatar();
|
||||||
String hash = org.jivesoftware.spark.util.StringUtils.hash(bytes);
|
if (bytes != null) {
|
||||||
update.setPhotoHash(hash);
|
String hash = org.jivesoftware.spark.util.StringUtils.hash(bytes);
|
||||||
jax.setPhotoHash(hash);
|
update.setPhotoHash(hash);
|
||||||
|
jax.setPhotoHash(hash);
|
||||||
|
|
||||||
newPresence.addExtension(update);
|
newPresence.addExtension(update);
|
||||||
newPresence.addExtension(jax);
|
newPresence.addExtension(jax);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}, presenceFilter);
|
}, presenceFilter);
|
||||||
|
|
||||||
@ -527,8 +528,8 @@ public class VCardManager {
|
|||||||
|
|
||||||
String query = getNumbersFromPhone(phoneNumber);
|
String query = getNumbersFromPhone(phoneNumber);
|
||||||
if ((homePhone != null && homePhone.contains(query)) ||
|
if ((homePhone != null && homePhone.contains(query)) ||
|
||||||
(workPhone != null && workPhone.contains(query)) ||
|
(workPhone != null && workPhone.contains(query)) ||
|
||||||
(cellPhone != null && cellPhone.contains(query))) {
|
(cellPhone != null && cellPhone.contains(query))) {
|
||||||
return vcard;
|
return vcard;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user