individual-widget: display channels list if available
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Thu, 10 Nov 2011 11:03:50 +0000 (12:03 +0100)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Wed, 16 Nov 2011 10:31:31 +0000 (11:31 +0100)
This will be needed when using this widget in MUC.

https://bugzilla.gnome.org/show_bug.cgi?id=663763

libempathy-gtk/empathy-individual-widget.c

index bbd8c9629f8334ea72265965d259993797c89c4c..4883c62e79cf3342c85aee6058ee0cfb29bd1564 100644 (file)
@@ -235,6 +235,9 @@ details_update_show (EmpathyIndividualWidget *self,
   EmpathyIndividualWidgetPriv *priv = GET_PRIV (self);
   GList *info, *l;
   guint n_rows = 0;
+  GtkWidget *channels_label;
+  TpConnection *conn;
+  TpAccount *account;
 
   info = tp_contact_get_contact_info (contact);
   info = g_list_sort (info, (GCompareFunc) empathy_contact_info_field_cmp);
@@ -287,6 +290,25 @@ details_update_show (EmpathyIndividualWidget *self,
 
       n_rows++;
     }
+
+  conn = tp_contact_get_connection (contact);
+  account = tp_connection_get_account (conn);
+
+  channels_label = empathy_contact_info_create_channel_list_label (account,
+      info, n_rows);
+
+  if (channels_label != NULL)
+    {
+      GtkWidget *title_widget;
+
+      title_widget =  gtk_label_new (_("Channels:"));
+
+      add_row (GTK_GRID (priv->grid_details), n_rows, title_widget,
+          channels_label);
+
+      n_rows++;
+    }
+
   g_list_free (info);
 
   return n_rows;