From af9646511992294411549884521130056f34f455 Mon Sep 17 00:00:00 2001 From: Will Thompson Date: Tue, 10 May 2011 17:44:03 +0100 Subject: ContactWidget: expose IRC presence information This is basically just a temporary hack until Idle implements SimplePresence. --- libempathy-gtk/empathy-contact-widget.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/libempathy-gtk/empathy-contact-widget.c b/libempathy-gtk/empathy-contact-widget.c index 39bac969c..14042bf61 100644 --- a/libempathy-gtk/empathy-contact-widget.c +++ b/libempathy-gtk/empathy-contact-widget.c @@ -322,6 +322,15 @@ format_server (GStrv values) return g_markup_printf_escaped ("%s (%s)", values[0], values[1]); } +static gchar * +presence_hack (GStrv values) +{ + if (tp_str_empty (values[0])) + return NULL; + + return g_markup_escape_text (values[0], -1); +} + static InfoFieldData info_field_datas[] = { { "fn", N_("Full name:"), NULL }, @@ -338,6 +347,11 @@ static InfoFieldData info_field_datas[] = { "x-irc-server", N_("Server:"), format_server }, { "x-host", N_("Connected from:"), format_server }, + /* FIXME: once Idle implements SimplePresence using this information, we can + * and should bin this. + */ + { "x-presence-status-message", N_("Away message:"), presence_hack }, + { NULL, NULL } }; -- cgit v1.2.3