aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy/gossip-presence.c
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@src.gnome.org>2007-05-03 01:39:27 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2007-05-03 01:39:27 +0800
commit563cdc5a284bc85957f60b14048ba6e42a0c7c87 (patch)
treebb0b4df3fa7e332602951d48c46384a9b3cb7ab3 /libempathy/gossip-presence.c
parent02fc345b94f6fa5d4a87ec2917e5fe846f9e755d (diff)
downloadgsoc2013-empathy-563cdc5a284bc85957f60b14048ba6e42a0c7c87.tar
gsoc2013-empathy-563cdc5a284bc85957f60b14048ba6e42a0c7c87.tar.gz
gsoc2013-empathy-563cdc5a284bc85957f60b14048ba6e42a0c7c87.tar.bz2
gsoc2013-empathy-563cdc5a284bc85957f60b14048ba6e42a0c7c87.tar.lz
gsoc2013-empathy-563cdc5a284bc85957f60b14048ba6e42a0c7c87.tar.xz
gsoc2013-empathy-563cdc5a284bc85957f60b14048ba6e42a0c7c87.tar.zst
gsoc2013-empathy-563cdc5a284bc85957f60b14048ba6e42a0c7c87.zip
[darcs-to-svn @ Autostart]
svn path=/trunk/; revision=27
Diffstat (limited to 'libempathy/gossip-presence.c')
-rw-r--r--libempathy/gossip-presence.c36
1 files changed, 32 insertions, 4 deletions
diff --git a/libempathy/gossip-presence.c b/libempathy/gossip-presence.c
index 1b04abc8f..ab0973d90 100644
--- a/libempathy/gossip-presence.c
+++ b/libempathy/gossip-presence.c
@@ -281,8 +281,35 @@ gossip_presence_state_get_default_status (McPresence state)
return _("Unavailable");
case MC_PRESENCE_OFFLINE:
return _("Offline");
+ case MC_PRESENCE_UNSET:
+ return _("Unset");
default:
- return NULL;
+ g_assert_not_reached ();
+ }
+
+ return NULL;
+}
+
+const gchar *
+gossip_presence_state_to_str (McPresence state)
+{
+ switch (state) {
+ case MC_PRESENCE_AVAILABLE:
+ return "available";
+ case MC_PRESENCE_DO_NOT_DISTURB:
+ return "busy";
+ case MC_PRESENCE_AWAY:
+ return "away";
+ case MC_PRESENCE_EXTENDED_AWAY:
+ return "ext_away";
+ case MC_PRESENCE_HIDDEN:
+ return "hidden";
+ case MC_PRESENCE_OFFLINE:
+ return "offline";
+ case MC_PRESENCE_UNSET:
+ return "unset";
+ default:
+ g_assert_not_reached ();
}
return NULL;
@@ -303,9 +330,10 @@ gossip_presence_state_from_str (const gchar *str)
return MC_PRESENCE_HIDDEN;
} else if (strcmp (str, "offline") == 0) {
return MC_PRESENCE_OFFLINE;
- } else if (strcmp (str, "chat") == 0) {
- /* We don't support chat, so treat it like available. */
- return MC_PRESENCE_AVAILABLE;
+ } else if (strcmp (str, "unset") == 0) {
+ return MC_PRESENCE_UNSET;
+ } else {
+ g_assert_not_reached ();
}
return MC_PRESENCE_AVAILABLE;