[empathy/more-contact-info: 6/7] ContactWidget: expose IRC presence information



commit cc5e51adcab711d73f200866e9a2d7e384f9557e
Author: Will Thompson <will thompson collabora co uk>
Date:   Tue May 10 17:44:03 2011 +0100

    ContactWidget: expose IRC presence information
    
    This is basically just a temporary hack until Idle implements
    SimplePresence.

 libempathy-gtk/empathy-contact-widget.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/libempathy-gtk/empathy-contact-widget.c b/libempathy-gtk/empathy-contact-widget.c
index 39bac96..14042bf 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 }
 };
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]