]> git.0d.be Git - empathy.git/commitdiff
contact-widget: rely on the factory to prepare TP_CONNECTION_FEATURE_CONTACT_INFO
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Thu, 18 Aug 2011 12:06:14 +0000 (14:06 +0200)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Fri, 19 Aug 2011 07:26:26 +0000 (09:26 +0200)
https://bugzilla.gnome.org/show_bug.cgi?id=656831

libempathy-gtk/empathy-contact-widget.c
libempathy/empathy-client-factory.c

index 14042bf61f5bd0eebdb261a5cf8cff981c0141dc..f73d75d19c6e93309a5f1089b7067af7a423c2a8 100644 (file)
@@ -792,16 +792,14 @@ contact_widget_details_request_cb (GObject *object,
 }
 
 static void
-contact_widget_details_feature_prepared_cb (GObject *object,
-    GAsyncResult *res,
-    gpointer user_data)
+fetch_contact_information (EmpathyContactWidget *information,
+        TpConnection *connection)
 {
-  TpConnection *connection = TP_CONNECTION (object);
-  EmpathyContactWidget *information = user_data;
   TpContact *contact;
   TpContactInfoFlags flags;
 
-  if (!tp_proxy_prepare_finish (connection, res, NULL))
+  if (!tp_proxy_has_interface_by_id (connection,
+          TP_IFACE_QUARK_CONNECTION_INTERFACE_CONTACT_INFO))
     {
       gtk_widget_hide (information->vbox_details);
       return;
@@ -846,13 +844,11 @@ contact_widget_details_update (EmpathyContactWidget *information)
 
   if (tp_contact != NULL)
     {
-      GQuark features[] = { TP_CONNECTION_FEATURE_CONTACT_INFO, 0 };
       TpConnection *connection;
 
-      /* First, make sure the CONTACT_INFO feature is ready on the connection */
       connection = tp_contact_get_connection (tp_contact);
-      tp_proxy_prepare_async (connection, features,
-          contact_widget_details_feature_prepared_cb, information);
+
+      fetch_contact_information (information, connection);
     }
 }
 
index 56e16629f47251cea5497dd58e805b9e1661e554..200ea5fe27b9008daf9eb55afb93bf2cba61e238 100644 (file)
@@ -143,6 +143,9 @@ empathy_client_factory_dup_connection_features (TpSimpleClientFactory *factory,
   feature = TP_CONNECTION_FEATURE_AVATAR_REQUIREMENTS;
   g_array_append_val (features, feature);
 
+  feature = TP_CONNECTION_FEATURE_CONTACT_INFO;
+  g_array_append_val (features, feature);
+
   return features;
 }