]> git.0d.be Git - empathy.git/commitdiff
ContactWidget: expose IRC presence information
authorWill Thompson <will.thompson@collabora.co.uk>
Tue, 10 May 2011 16:44:03 +0000 (17:44 +0100)
committerWill Thompson <will.thompson@collabora.co.uk>
Mon, 16 May 2011 12:31:04 +0000 (13:31 +0100)
This is basically just a temporary hack until Idle implements
SimplePresence.

libempathy-gtk/empathy-contact-widget.c

index 39bac969c18e783fbf0fbfbf2a19f52f4d2b00fd..14042bf61f5bd0eebdb261a5cf8cff981c0141dc 100644 (file)
@@ -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 }
 };