]> git.0d.be Git - empathy.git/commitdiff
add empathy_status_presets_is_valid
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Wed, 17 Jun 2009 17:36:28 +0000 (18:36 +0100)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Thu, 18 Jun 2009 08:35:03 +0000 (09:35 +0100)
libempathy/empathy-status-presets.c
libempathy/empathy-status-presets.h

index 9f9a2030bccd4fa6c69e0d30c6fef036105a65dc..ec3f23251e25bef0ab01e6fa10ba285d31e6fe0e 100644 (file)
@@ -405,3 +405,23 @@ empathy_status_presets_clear_default (void)
 
        status_presets_file_save ();
 }
+
+gboolean
+empathy_status_presets_is_valid (TpConnectionPresenceType state)
+{
+       switch (state) {
+               case TP_CONNECTION_PRESENCE_TYPE_UNSET:
+               case TP_CONNECTION_PRESENCE_TYPE_OFFLINE:
+               case TP_CONNECTION_PRESENCE_TYPE_UNKNOWN:
+               case TP_CONNECTION_PRESENCE_TYPE_ERROR:
+                       return FALSE;
+
+               case TP_CONNECTION_PRESENCE_TYPE_AVAILABLE:
+               case TP_CONNECTION_PRESENCE_TYPE_AWAY:
+               case TP_CONNECTION_PRESENCE_TYPE_EXTENDED_AWAY:
+               case TP_CONNECTION_PRESENCE_TYPE_HIDDEN:
+               case TP_CONNECTION_PRESENCE_TYPE_BUSY:
+                       return TRUE;
+       }
+       return FALSE;
+}
index 335dbcfcb2b18e9b1a0d014b5b6c1c18fdf0b42b..331c630d50c9b21fad0ee54bf2e2a87290b92d59 100644 (file)
@@ -40,6 +40,7 @@ const gchar * empathy_status_presets_get_default_status (void);
 void          empathy_status_presets_set_default        (TpConnectionPresenceType   state,
                                                         const gchar *status);
 void          empathy_status_presets_clear_default      (void);
+gboolean      empathy_status_presets_is_valid           (TpConnectionPresenceType   state);
 
 G_END_DECLS