diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2010-03-24 18:22:53 +0800 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2010-03-30 18:09:44 +0800 |
commit | 944632a01dd934666170583b87e970f32211f810 (patch) | |
tree | 21442513b9d2716e8b54f8f1f722333e329f833b /libempathy | |
parent | 6af5464b86a9e013ffc36b5243055c5c0d8495f9 (diff) | |
download | gsoc2013-empathy-944632a01dd934666170583b87e970f32211f810.tar gsoc2013-empathy-944632a01dd934666170583b87e970f32211f810.tar.gz gsoc2013-empathy-944632a01dd934666170583b87e970f32211f810.tar.bz2 gsoc2013-empathy-944632a01dd934666170583b87e970f32211f810.tar.lz gsoc2013-empathy-944632a01dd934666170583b87e970f32211f810.tar.xz gsoc2013-empathy-944632a01dd934666170583b87e970f32211f810.tar.zst gsoc2013-empathy-944632a01dd934666170583b87e970f32211f810.zip |
factor out got_list_channel
Diffstat (limited to 'libempathy')
-rw-r--r-- | libempathy/empathy-tp-contact-list.c | 46 |
1 files changed, 27 insertions, 19 deletions
diff --git a/libempathy/empathy-tp-contact-list.c b/libempathy/empathy-tp-contact-list.c index b273ad20e..2f2717b44 100644 --- a/libempathy/empathy-tp-contact-list.c +++ b/libempathy/empathy-tp-contact-list.c @@ -698,49 +698,57 @@ tp_contact_list_finalize (GObject *object) } static void -list_ensure_channel_cb (TpConnection *conn, - gboolean yours, - const gchar *path, - GHashTable *properties, - const GError *error, - gpointer user_data, - GObject *weak_object) +got_list_channel (EmpathyTpContactList *list, + TpChannel *channel) { - EmpathyTpContactList *list = user_data; EmpathyTpContactListPriv *priv = GET_PRIV (list); const gchar *id; - TpChannel *channel; - - if (error != NULL) { - DEBUG ("failed: %s\n", error->message); - return; - } /* We requested that channel by providing TargetID property, so it's * guaranteed that tp_channel_get_identifier will return it. */ - channel = tp_channel_new_from_properties (conn, path, properties, NULL); id = tp_channel_get_identifier (channel); /* TpChannel emits initial set of members just before being ready */ if (!tp_strdiff (id, "stored")) { - priv->stored = channel; + priv->stored = g_object_ref (channel); } else if (!tp_strdiff (id, "publish")) { - priv->publish = channel; + priv->publish = g_object_ref (channel); g_signal_connect (priv->publish, "group-members-changed", G_CALLBACK (tp_contact_list_publish_group_members_changed_cb), list); } else if (!tp_strdiff (id, "subscribe")) { - priv->subscribe = channel; + priv->subscribe = g_object_ref (channel); g_signal_connect (priv->subscribe, "group-members-changed", G_CALLBACK (tp_contact_list_subscribe_group_members_changed_cb), list); } else { g_warn_if_reached (); - g_object_unref (channel); } } static void +list_ensure_channel_cb (TpConnection *conn, + gboolean yours, + const gchar *path, + GHashTable *properties, + const GError *error, + gpointer user_data, + GObject *weak_object) +{ + EmpathyTpContactList *list = user_data; + TpChannel *channel; + + if (error != NULL) { + DEBUG ("failed: %s\n", error->message); + return; + } + + channel = tp_channel_new_from_properties (conn, path, properties, NULL); + got_list_channel (list, channel); + g_object_unref (channel); +} + +static void conn_ready_cb (TpConnection *connection, const GError *error, gpointer data) |