[empathy: 4/8] log an error if SetContactInfo() fails



commit a2421fe9c16830e31ffab506d65a4463fd2b5e03
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Wed Oct 20 12:57:31 2010 +0200

    log an error if SetContactInfo() fails

 libempathy-gtk/empathy-contact-widget.c |   20 +++++++++++++++++++-
 1 files changed, 19 insertions(+), 1 deletions(-)
---
diff --git a/libempathy-gtk/empathy-contact-widget.c b/libempathy-gtk/empathy-contact-widget.c
index 947fbfa..98a2fa7 100644
--- a/libempathy-gtk/empathy-contact-widget.c
+++ b/libempathy-gtk/empathy-contact-widget.c
@@ -165,6 +165,24 @@ field_value_is_empty (TpContactInfoField *field)
 }
 
 static void
+set_contact_info_cb (GObject *source,
+    GAsyncResult *result,
+    gpointer user_data)
+{
+  GError *error = NULL;
+
+  if (!tp_connection_set_contact_info_finish (TP_CONNECTION (source), result,
+        &error))
+    {
+      DEBUG ("SetContactInfo() failed: %s", error->message);
+      g_error_free (error);
+      return;
+    }
+
+  DEBUG ("SetContactInfo() succeeded");
+}
+
+static void
 contact_widget_save (EmpathyContactWidget *information)
 {
   TpConnection *connection;
@@ -190,7 +208,7 @@ contact_widget_save (EmpathyContactWidget *information)
   if (information->details_to_set != NULL)
     {
       tp_connection_set_contact_info_async (connection,
-          information->details_to_set, NULL, NULL);
+          information->details_to_set, set_contact_info_cb, NULL);
       tp_contact_info_list_free (information->details_to_set);
       information->details_to_set = NULL;
     }



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