aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy
diff options
context:
space:
mode:
authorJonny Lamb <jonny.lamb@collabora.co.uk>2009-01-15 22:47:16 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2009-01-15 22:47:16 +0800
commit88558be0863a90194e52d7a9de1f46088d801a13 (patch)
treeb1316d31b14288a50640b5a174e61645f884991d /libempathy
parent811058b7e0803da92939291021bc9af23aab609a (diff)
downloadgsoc2013-empathy-88558be0863a90194e52d7a9de1f46088d801a13.tar
gsoc2013-empathy-88558be0863a90194e52d7a9de1f46088d801a13.tar.gz
gsoc2013-empathy-88558be0863a90194e52d7a9de1f46088d801a13.tar.bz2
gsoc2013-empathy-88558be0863a90194e52d7a9de1f46088d801a13.tar.lz
gsoc2013-empathy-88558be0863a90194e52d7a9de1f46088d801a13.tar.xz
gsoc2013-empathy-88558be0863a90194e52d7a9de1f46088d801a13.tar.zst
gsoc2013-empathy-88558be0863a90194e52d7a9de1f46088d801a13.zip
When sending files, make sure the connection is ready before making sure the contact is ready.
Signed-off-by: Jonny Lamb <jonny.lamb@collabora.co.uk> svn path=/trunk/; revision=2231
Diffstat (limited to 'libempathy')
-rw-r--r--libempathy/empathy-dispatcher.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/libempathy/empathy-dispatcher.c b/libempathy/empathy-dispatcher.c
index 396fd9bbb..e345df61d 100644
--- a/libempathy/empathy-dispatcher.c
+++ b/libempathy/empathy-dispatcher.c
@@ -1245,6 +1245,25 @@ dispatcher_create_channel_with_contact_cb (EmpathyContact *contact,
G_OBJECT (request_data->dispatcher));
}
+static void
+dispatcher_send_file_connection_ready_cb (TpConnection *connection,
+ const GError *error,
+ gpointer user_data)
+{
+ DispatcherRequestData *request_data = (DispatcherRequestData *) user_data;
+
+ if (error != NULL)
+ {
+ dispatcher_request_failed (request_data->dispatcher,
+ request_data, error);
+ return;
+ }
+
+ empathy_contact_call_when_ready (request_data->contact,
+ EMPATHY_CONTACT_READY_HANDLE, dispatcher_create_channel_with_contact_cb,
+ request_data, NULL, G_OBJECT (request_data->dispatcher));
+}
+
void
empathy_dispatcher_send_file_to_contact (EmpathyContact *contact,
const gchar *filename, guint64 size, guint64 date,
@@ -1304,9 +1323,8 @@ empathy_dispatcher_send_file_to_contact (EmpathyContact *contact,
connection_data->outstanding_requests = g_list_prepend
(connection_data->outstanding_requests, request_data);
- empathy_contact_call_when_ready (contact,
- EMPATHY_CONTACT_READY_HANDLE, dispatcher_create_channel_with_contact_cb,
- request_data, NULL, G_OBJECT (dispatcher));
+ tp_connection_call_when_ready (connection,
+ dispatcher_send_file_connection_ready_cb, (gpointer) request_data);
g_object_unref (dispatcher);
}