]> git.0d.be Git - empathy.git/commitdiff
use the 'user-invisible' icon if implemented
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Tue, 2 Mar 2010 11:16:52 +0000 (12:16 +0100)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Tue, 30 Mar 2010 10:38:10 +0000 (12:38 +0200)
libempathy-gtk/empathy-images.h
libempathy-gtk/empathy-ui-utils.c

index c303fe79a1c6d2578f24d331c6d9fcbee45db8f1..d5fa536b153ce2efd7c77a9cacba715077e0247a 100644 (file)
@@ -25,7 +25,9 @@
 G_BEGIN_DECLS
 
 #define EMPATHY_IMAGE_OFFLINE             "user-offline"
-#define EMPATHY_IMAGE_HIDDEN              "user-offline"
+/* user-invisible is not (yet?) in the naming spec but already implemented by
+ * some theme */
+#define EMPATHY_IMAGE_HIDDEN              "user-invisible"
 #define EMPATHY_IMAGE_AVAILABLE           "user-available"
 #define EMPATHY_IMAGE_BUSY                "user-busy"
 #define EMPATHY_IMAGE_AWAY                "user-away"
index d4de211c08f1337d5663c0952efc1862e2fb838b..422eb910f3ae69fe0d4b35b1994a96677889b9d1 100644 (file)
@@ -183,7 +183,13 @@ empathy_icon_name_for_presence (TpConnectionPresenceType presence)
        case TP_CONNECTION_PRESENCE_TYPE_EXTENDED_AWAY:
                return EMPATHY_IMAGE_EXT_AWAY;
        case TP_CONNECTION_PRESENCE_TYPE_HIDDEN:
-               return EMPATHY_IMAGE_HIDDEN;
+               if (gtk_icon_theme_has_icon (gtk_icon_theme_get_default (),
+                                            EMPATHY_IMAGE_HIDDEN))
+                       return EMPATHY_IMAGE_HIDDEN;
+
+               /* The 'hidden' icon is not an official one so we fallback to offline if
+                * it's not implemented */
+               return EMPATHY_IMAGE_OFFLINE;
        case TP_CONNECTION_PRESENCE_TYPE_OFFLINE:
        case TP_CONNECTION_PRESENCE_TYPE_ERROR:
        case TP_CONNECTION_PRESENCE_TYPE_UNKNOWN: