]> git.0d.be Git - empathy.git/blobdiff - libempathy/empathy-dispatcher.c
Merge branch 'master' into tp-tube
[empathy.git] / libempathy / empathy-dispatcher.c
index ef5bd5d8fa5582f4ed7ab66171701b233cd4248c..c8a0f9e60b043e5effd618a6ab3d71930267c841 100644 (file)
@@ -228,11 +228,8 @@ dispatcher_connection_invalidated_cb (TpConnection *connection,
                                       EmpathyDispatcher *dispatcher)
 {
   EmpathyDispatcherPriv *priv = GET_PRIV (dispatcher);
-  ConnectionData *cd;
 
   DEBUG ("Error: %s", message);
-  cd = g_hash_table_lookup (priv->connections, connection);
-
   g_hash_table_remove (priv->connections, connection);
 }
 
@@ -356,7 +353,6 @@ dispatch_operation_claimed_cb (EmpathyDispatchOperation *operation,
   connection = empathy_dispatch_operation_get_tp_connection (operation);
   cd = g_hash_table_lookup (priv->connections, connection);
   g_assert (cd != NULL);
-  g_object_unref (G_OBJECT (connection));
 
   object_path = empathy_dispatch_operation_get_object_path (operation);
 
@@ -400,7 +396,6 @@ dispatch_operation_ready_cb (EmpathyDispatchOperation *operation,
   connection =  empathy_dispatch_operation_get_tp_connection (operation);
   cd = g_hash_table_lookup (priv->connections, connection);
   g_assert (cd != NULL);
-  g_object_unref (G_OBJECT (connection));
 
   g_object_ref (operation);
   g_object_ref (dispatcher);
@@ -1149,13 +1144,23 @@ typedef struct
 
 static void
 dispatcher_chat_with_contact_id_cb (EmpathyTpContactFactory *factory,
-                                    GList                   *contacts,
+                                    EmpathyContact          *contact,
+                                    const GError            *error,
                                     gpointer                 user_data,
                                     GObject                 *weak_object)
 {
   ChatWithContactIdData *data = user_data;
 
-  empathy_dispatcher_chat_with_contact (contacts->data, data->callback, data->user_data);
+  if (error)
+    {
+      /* FIXME: Should call data->callback with the error */
+      DEBUG ("Error: %s", error->message);
+    }
+  else
+    {
+      empathy_dispatcher_chat_with_contact (contact, data->callback, data->user_data);
+    }
+
   g_object_unref (data->dispatcher);
   g_slice_free (ChatWithContactIdData, data);
 }
@@ -1179,7 +1184,7 @@ empathy_dispatcher_chat_with_contact_id (TpConnection *connection,
   data->dispatcher = dispatcher;
   data->callback = callback;
   data->user_data = user_data;
-  empathy_tp_contact_factory_get_from_ids (factory, 1, &contact_id,
+  empathy_tp_contact_factory_get_from_id (factory, contact_id,
       dispatcher_chat_with_contact_id_cb, data, NULL, NULL);
 
   g_object_unref (factory);