aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk/gossip-stock.c
diff options
context:
space:
mode:
Diffstat (limited to 'libempathy-gtk/gossip-stock.c')
-rw-r--r--libempathy-gtk/gossip-stock.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/libempathy-gtk/gossip-stock.c b/libempathy-gtk/gossip-stock.c
index f43949ee4..1490e65e7 100644
--- a/libempathy-gtk/gossip-stock.c
+++ b/libempathy-gtk/gossip-stock.c
@@ -103,3 +103,27 @@ gossip_stock_render (const gchar *stock,
return gtk_widget_render_icon (main_widget, stock, size, NULL);
}
+const gchar *
+gossip_stock_for_state (McPresence state)
+{
+ switch (state) {
+ case MC_PRESENCE_AVAILABLE:
+ return GOSSIP_STOCK_AVAILABLE;
+ case MC_PRESENCE_DO_NOT_DISTURB:
+ return GOSSIP_STOCK_BUSY;
+ case MC_PRESENCE_AWAY:
+ return GOSSIP_STOCK_AWAY;
+ case MC_PRESENCE_EXTENDED_AWAY:
+ return GOSSIP_STOCK_EXT_AWAY;
+ case MC_PRESENCE_HIDDEN:
+ case MC_PRESENCE_OFFLINE:
+ case MC_PRESENCE_UNSET:
+ return GOSSIP_STOCK_OFFLINE;
+ default:
+ g_assert_not_reached ();
+ }
+
+ return NULL;
+}
+
+