SPARK-1593 (#255)

This commit is contained in:
Speedy
2016-11-06 04:44:42 -06:00
committed by wroot
parent ef78fc9166
commit acfbeccf2a
2 changed files with 6 additions and 3 deletions

View File

@ -34,6 +34,9 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import static org.jivesoftware.smack.util.StringUtils.isEmpty;
import static org.jivesoftware.smack.util.StringUtils.isNullOrEmpty;
/**
* Handles the most common presence checks.
*
@ -159,7 +162,7 @@ public class PresenceManager {
*/
public static Icon getIconFromPresence(Presence presence) {
if (isInvisible(presence)) {
return SparkRes.getImageIcon(SparkRes.INVISIBLE);
return SparkRes.getImageIcon(SparkRes.CLEAR_BALL_ICON);
}
// Handle offline presence
@ -228,7 +231,7 @@ public class PresenceManager {
public static boolean isInvisible(Presence presence) {
return presence != null && presence.getType() == Presence.Type.unavailable
&& (Res.getString("status.invisible").equalsIgnoreCase(presence.getStatus())
|| Res.getString("status.offline").equalsIgnoreCase(presence.getStatus()))
|| isNullOrEmpty(presence.getStatus()))
&& Presence.Mode.available == presence.getMode();
}

View File

@ -668,7 +668,7 @@ public class StatusBar extends JPanel implements VCardListener {
Presence copyPresence = copyPresence(presence);
if (isNewPresenceInvisible) {
copyPresence.setStatus(Res.getString("status.offline"));
copyPresence.setStatus(null);
}
if (PresenceManager.areEqual(getCurrentPresence(), copyPresence)) {
return presence.getStatus();