[empathy/more-contact-info: 5/7] ContactWidget: support IRC server and host info



commit cdf0cd1e2e4bbc31d6d543811eaf6a8a128bb311
Author: Will Thompson <will thompson collabora co uk>
Date:   Tue May 10 17:40:25 2011 +0100

    ContactWidget: support IRC server and host info

 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 1b2570d..39bac96 100644
--- a/libempathy-gtk/empathy-contact-widget.c
+++ b/libempathy-gtk/empathy-contact-widget.c
@@ -311,6 +311,17 @@ format_idle_time (GStrv values)
   return empathy_duration_to_string (duration);
 }
 
+static gchar *
+format_server (GStrv values)
+{
+  g_assert (values[0] != NULL);
+
+  if (values[1] == NULL)
+    return g_markup_escape_text (values[0], -1);
+  else
+    return g_markup_printf_escaped ("%s (%s)", values[0], values[1]);
+}
+
 static InfoFieldData info_field_datas[] =
 {
   { "fn",    N_("Full name:"),      NULL },
@@ -324,6 +335,9 @@ static InfoFieldData info_field_datas[] =
    * with their IM client.
    */
   { "x-idle-time", N_("Last seen:"), format_idle_time },
+  { "x-irc-server", N_("Server:"), format_server },
+  { "x-host", N_("Connected from:"), format_server },
+
   { NULL, NULL }
 };
 



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