aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2009-04-28 16:59:07 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2009-04-28 16:59:07 +0800
commit0ced9a43b562b567d97a98d18da2bceaff3e68e3 (patch)
tree31b1f74ef4d67cd642b53495bcf5c3cc3498d3e6 /libempathy
parent5d3fb4fdc5bfe04e639b44650d79efc7ff24e139 (diff)
downloadgsoc2013-empathy-0ced9a43b562b567d97a98d18da2bceaff3e68e3.tar
gsoc2013-empathy-0ced9a43b562b567d97a98d18da2bceaff3e68e3.tar.gz
gsoc2013-empathy-0ced9a43b562b567d97a98d18da2bceaff3e68e3.tar.bz2
gsoc2013-empathy-0ced9a43b562b567d97a98d18da2bceaff3e68e3.tar.lz
gsoc2013-empathy-0ced9a43b562b567d97a98d18da2bceaff3e68e3.tar.xz
gsoc2013-empathy-0ced9a43b562b567d97a98d18da2bceaff3e68e3.tar.zst
gsoc2013-empathy-0ced9a43b562b567d97a98d18da2bceaff3e68e3.zip
tube-handler: use tp_channel_call_when_ready instead of tp_channel_run_until_ready
Diffstat (limited to 'libempathy')
-rw-r--r--libempathy/empathy-tube-handler.c29
1 files changed, 23 insertions, 6 deletions
diff --git a/libempathy/empathy-tube-handler.c b/libempathy/empathy-tube-handler.c
index cbd004d14..d4c4d63be 100644
--- a/libempathy/empathy-tube-handler.c
+++ b/libempathy/empathy-tube-handler.c
@@ -86,6 +86,28 @@ tube_ready_destroy_notify (gpointer data)
}
static void
+channel_ready_cb (TpChannel *channel,
+ const GError *error,
+ gpointer data)
+{
+ IdleData *idle_data = data;
+
+ if (error != NULL)
+ {
+ DEBUG ("channel has been invalidated: %s", error->message);
+ tube_ready_destroy_notify (data);
+ g_object_unref (channel);
+ return;
+ }
+
+ idle_data->tube = empathy_tp_tube_new (channel);
+ empathy_tp_tube_call_when_ready (idle_data->tube, tube_ready_cb, idle_data,
+ tube_ready_destroy_notify, NULL);
+
+ g_object_unref (channel);
+}
+
+static void
connection_ready_cb (TpConnection *connection,
const GError *error,
gpointer data)
@@ -104,13 +126,8 @@ connection_ready_cb (TpConnection *connection,
channel = tp_channel_new (connection, idle_data->channel,
TP_IFACE_CHANNEL_TYPE_TUBES, idle_data->handle_type,
idle_data->handle, NULL);
- tp_channel_run_until_ready (channel, NULL, NULL);
+ tp_channel_call_when_ready (channel, channel_ready_cb, idle_data);
- idle_data->tube = empathy_tp_tube_new (channel);
- empathy_tp_tube_call_when_ready (idle_data->tube, tube_ready_cb, idle_data,
- tube_ready_destroy_notify, NULL);
-
- g_object_unref (channel);
g_object_unref (connection);
}