diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2009-06-18 01:36:28 +0800 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2009-06-18 16:35:03 +0800 |
commit | 4ce928ce7b856c9fcbf61595fae83eed22b90b25 (patch) | |
tree | 276b70ccaf5abcece272fc15fecb56776bee88c7 | |
parent | 16738495eb7c0d205ffb92bd2997a7ddf03e85a0 (diff) | |
download | gsoc2013-empathy-4ce928ce7b856c9fcbf61595fae83eed22b90b25.tar gsoc2013-empathy-4ce928ce7b856c9fcbf61595fae83eed22b90b25.tar.gz gsoc2013-empathy-4ce928ce7b856c9fcbf61595fae83eed22b90b25.tar.bz2 gsoc2013-empathy-4ce928ce7b856c9fcbf61595fae83eed22b90b25.tar.lz gsoc2013-empathy-4ce928ce7b856c9fcbf61595fae83eed22b90b25.tar.xz gsoc2013-empathy-4ce928ce7b856c9fcbf61595fae83eed22b90b25.tar.zst gsoc2013-empathy-4ce928ce7b856c9fcbf61595fae83eed22b90b25.zip |
add empathy_status_presets_is_valid
-rw-r--r-- | libempathy/empathy-status-presets.c | 20 | ||||
-rw-r--r-- | libempathy/empathy-status-presets.h | 1 |
2 files changed, 21 insertions, 0 deletions
diff --git a/libempathy/empathy-status-presets.c b/libempathy/empathy-status-presets.c index 9f9a2030b..ec3f23251 100644 --- a/libempathy/empathy-status-presets.c +++ b/libempathy/empathy-status-presets.c @@ -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; +} diff --git a/libempathy/empathy-status-presets.h b/libempathy/empathy-status-presets.h index 335dbcfcb..331c630d5 100644 --- a/libempathy/empathy-status-presets.h +++ b/libempathy/empathy-status-presets.h @@ -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 |