]> git.0d.be Git - empathy.git/commitdiff
call cb with an error if dispatcher_chat_with_contact* fails
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Mon, 19 Apr 2010 13:30:23 +0000 (15:30 +0200)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Mon, 19 Apr 2010 13:30:23 +0000 (15:30 +0200)
libempathy/empathy-dispatcher.c

index 8d91928f6f0c60c106c0c6dcc23160df19f6f828..5cff9d8426d0c9e682cc90ea3e9c48985411d329 100644 (file)
@@ -1449,6 +1449,12 @@ empathy_dispatcher_chat_with_contact (EmpathyContact *contact,
   if (connection_data == NULL)
     {
       /* Connection has been invalidated */
+      if (callback != NULL)
+        {
+          GError error = { TP_DBUS_ERRORS, TP_DBUS_ERROR_PROXY_UNREFERENCED,
+              "Connection has been invalidated" };
+          callback (NULL, &error, user_data);
+        }
       goto out;
     }
 
@@ -1485,8 +1491,12 @@ dispatcher_chat_with_contact_id_cb (EmpathyTpContactFactory *factory,
 
   if (error)
     {
-      /* FIXME: Should call data->callback with the error */
       DEBUG ("Error: %s", error->message);
+
+      if (data->callback != NULL)
+        {
+          data->callback (NULL, error, data->user_data);
+        }
     }
   else
     {