Refactoring of presence using latest Smack.

git-svn-id: http://svn.igniterealtime.org/svn/repos/spark/trunk@7207 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
Derek DeMoro
2007-02-20 00:08:03 +00:00
committed by derek
parent f26a8e8543
commit 06f295f71b
9 changed files with 149 additions and 138 deletions

View File

@ -22,7 +22,6 @@ import org.jivesoftware.spark.ui.ContactGroup;
import org.jivesoftware.spark.ui.ContactItem;
import org.jivesoftware.spark.ui.ContactList;
import org.jivesoftware.spark.ui.rooms.GroupChatRoom;
import org.jivesoftware.spark.ui.status.StatusItem;
import org.jivesoftware.spark.util.ModelUtil;
import org.jivesoftware.spark.util.log.Log;
import org.jivesoftware.sparkimpl.profile.VCardManager;
@ -354,36 +353,7 @@ public class UserManager {
return presence.getFrom();
}
/**
* Returns the Icon associated with the presence.
*
* @param presence the presence.
* @return the icon.
*/
public Icon getTabIconForPresence(Presence presence) {
StatusItem statusItem = SparkManager.getWorkspace().getStatusBar().getItemFromPresence(presence);
Icon tabIcon = null;
if (statusItem == null) {
tabIcon = SparkRes.getImageIcon(SparkRes.CLEAR_BALL_ICON);
}
else {
String status = presence.getStatus();
if (status != null && status.indexOf("phone") != -1) {
tabIcon = SparkRes.getImageIcon(SparkRes.ON_PHONE_IMAGE);
}
else {
tabIcon = statusItem.getIcon();
}
}
Icon icon = SparkManager.getChatManager().getTabIconForContactHandler(presence);
if (icon != null) {
tabIcon = icon;
}
return tabIcon;
}
public void searchContacts(String contact, final JFrame parent) {
if (parents.get(parent) == null) {