aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2009-04-28 17:59:39 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2009-04-28 20:13:55 +0800
commit1b81df990ef44eb9aceee1752fe9d6c2c04d8c21 (patch)
tree682901e4349fa65b85ee479f5f78c1d96cab53e8 /libempathy
parent01371c6a48109e673fbec918fba8ad6c83abd8a5 (diff)
downloadgsoc2013-empathy-1b81df990ef44eb9aceee1752fe9d6c2c04d8c21.tar
gsoc2013-empathy-1b81df990ef44eb9aceee1752fe9d6c2c04d8c21.tar.gz
gsoc2013-empathy-1b81df990ef44eb9aceee1752fe9d6c2c04d8c21.tar.bz2
gsoc2013-empathy-1b81df990ef44eb9aceee1752fe9d6c2c04d8c21.tar.lz
gsoc2013-empathy-1b81df990ef44eb9aceee1752fe9d6c2c04d8c21.tar.xz
gsoc2013-empathy-1b81df990ef44eb9aceee1752fe9d6c2c04d8c21.tar.zst
gsoc2013-empathy-1b81df990ef44eb9aceee1752fe9d6c2c04d8c21.zip
tp-roomlist: use tp_channel_call_when_ready instead of tp_channel_run_until_ready
Diffstat (limited to 'libempathy')
-rw-r--r--libempathy/empathy-tp-roomlist.c42
1 files changed, 29 insertions, 13 deletions
diff --git a/libempathy/empathy-tp-roomlist.c b/libempathy/empathy-tp-roomlist.c
index fc2526fd0..5999663fb 100644
--- a/libempathy/empathy-tp-roomlist.c
+++ b/libempathy/empathy-tp-roomlist.c
@@ -236,25 +236,19 @@ tp_roomlist_invalidated_cb (TpChannel *channel,
}
static void
-tp_roomlist_request_channel_cb (TpConnection *connection,
- const gchar *object_path,
- const GError *error,
- gpointer user_data,
- GObject *list)
+channel_ready_cb (TpChannel *channel,
+ const GError *error,
+ gpointer user_data)
{
+ EmpathyTpRoomlist *list = EMPATHY_TP_ROOMLIST (user_data);
EmpathyTpRoomlistPriv *priv = GET_PRIV (list);
- if (error) {
- DEBUG ("Error requesting channel: %s", error->message);
+ if (error != NULL) {
+ DEBUG ("Channel invalidated: %s", error->message);
+ g_signal_emit (list, signals[DESTROY], 0);
return;
}
- priv->channel = tp_channel_new (priv->connection, object_path,
- TP_IFACE_CHANNEL_TYPE_ROOM_LIST,
- TP_HANDLE_TYPE_NONE,
- 0, NULL);
- tp_channel_run_until_ready (priv->channel, NULL, NULL);
-
g_signal_connect (priv->channel, "invalidated",
G_CALLBACK (tp_roomlist_invalidated_cb),
list);
@@ -274,6 +268,28 @@ tp_roomlist_request_channel_cb (TpConnection *connection,
tp_roomlist_get_listing_rooms_cb,
NULL, NULL,
G_OBJECT (list));
+
+}
+
+static void
+tp_roomlist_request_channel_cb (TpConnection *connection,
+ const gchar *object_path,
+ const GError *error,
+ gpointer user_data,
+ GObject *list)
+{
+ EmpathyTpRoomlistPriv *priv = GET_PRIV (list);
+
+ if (error) {
+ DEBUG ("Error requesting channel: %s", error->message);
+ return;
+ }
+
+ priv->channel = tp_channel_new (priv->connection, object_path,
+ TP_IFACE_CHANNEL_TYPE_ROOM_LIST,
+ TP_HANDLE_TYPE_NONE,
+ 0, NULL);
+ tp_channel_call_when_ready (priv->channel, channel_ready_cb, list);
}
static void