From 4ce928ce7b856c9fcbf61595fae83eed22b90b25 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Wed, 17 Jun 2009 18:36:28 +0100 Subject: add empathy_status_presets_is_valid --- libempathy/empathy-status-presets.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'libempathy/empathy-status-presets.c') 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; +} -- cgit v1.2.3