summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonny Lamb <jonnylamb@gnome.org>2010-12-14 12:56:13 +0000
committerJonny Lamb <jonnylamb@gnome.org>2010-12-15 09:30:47 +0000
commit236db35cef7b1b435847486fc935e7e374fe4adb (patch)
treea70f27ba822dbd2f65f63ce75f3893b8487a4979
parent01e46c64a9dc944929f30d760f56038be0d2a78f (diff)
contact-view: use empathy_presence_get_default_message
Signed-off-by: Jonny Lamb <jonnylamb@gnome.org>
-rw-r--r--liszt/contact-view.c31
1 files changed, 5 insertions, 26 deletions
diff --git a/liszt/contact-view.c b/liszt/contact-view.c
index 41ef7978e..920aa80e2 100644
--- a/liszt/contact-view.c
+++ b/liszt/contact-view.c
@@ -5,6 +5,7 @@
#include <libempathy/empathy-dispatcher.h>
#include <libempathy/empathy-call-factory.h>
+#include <libempathy/empathy-utils.h>
G_DEFINE_TYPE (LolContactView, lol_contact_view, CLUTTER_TYPE_BOX)
@@ -41,31 +42,6 @@ lol_contact_view_init (LolContactView *self)
LolContactViewPrivate);
}
-static const gchar *
-lol_contact_view_get_presence_string (FolksPresenceType presence)
-{
- switch (presence)
- {
- case FOLKS_PRESENCE_TYPE_AVAILABLE:
- return "Available";
- break;
- case FOLKS_PRESENCE_TYPE_AWAY:
- case FOLKS_PRESENCE_TYPE_EXTENDED_AWAY:
- return "Away";
- break;
- case FOLKS_PRESENCE_TYPE_HIDDEN:
- case FOLKS_PRESENCE_TYPE_BUSY:
- return "Busy";
- break;
- case FOLKS_PRESENCE_TYPE_UNKNOWN:
- case FOLKS_PRESENCE_TYPE_UNSET:
- case FOLKS_PRESENCE_TYPE_OFFLINE:
- case FOLKS_PRESENCE_TYPE_ERROR:
- default:
- return "";
- }
-}
-
static void
lol_contact_view_set_markup (LolContactView *self,
const gchar *text,
@@ -73,9 +49,12 @@ lol_contact_view_set_markup (LolContactView *self,
{
LolContactViewPrivate *priv = self->priv;
gchar *markup;
+ TpConnectionPresenceType tmp;
+
+ tmp = empathy_folks_presence_type_to_tp (presence);
markup = g_strdup_printf ("%s\n<span size=\"x-small\">%s</span>",
- text, lol_contact_view_get_presence_string (presence));
+ text, empathy_presence_get_default_message (tmp));
clutter_text_set_markup (CLUTTER_TEXT (priv->name_text), markup);
g_free (markup);
}