diff options
author | Xavier Claessens <xclaesse@src.gnome.org> | 2008-03-11 20:22:37 +0800 |
---|---|---|
committer | Xavier Claessens <xclaesse@src.gnome.org> | 2008-03-11 20:22:37 +0800 |
commit | fd6d3fc84dbd00c3c1015ac8f9b54935fc1c12e9 (patch) | |
tree | fa43f89134570a145e721945b72da07d27ac4f3f /libempathy/empathy-tp-call.c | |
parent | cf327059e269141a38a3aa38f0a37d3c6eb0fbbb (diff) | |
download | gsoc2013-empathy-fd6d3fc84dbd00c3c1015ac8f9b54935fc1c12e9.tar gsoc2013-empathy-fd6d3fc84dbd00c3c1015ac8f9b54935fc1c12e9.tar.gz gsoc2013-empathy-fd6d3fc84dbd00c3c1015ac8f9b54935fc1c12e9.tar.bz2 gsoc2013-empathy-fd6d3fc84dbd00c3c1015ac8f9b54935fc1c12e9.tar.lz gsoc2013-empathy-fd6d3fc84dbd00c3c1015ac8f9b54935fc1c12e9.tar.xz gsoc2013-empathy-fd6d3fc84dbd00c3c1015ac8f9b54935fc1c12e9.tar.zst gsoc2013-empathy-fd6d3fc84dbd00c3c1015ac8f9b54935fc1c12e9.zip |
Make sure we don't expect contact id and handle to be directly ready. Add some _run_until_ready.
svn path=/trunk/; revision=755
Diffstat (limited to 'libempathy/empathy-tp-call.c')
-rw-r--r-- | libempathy/empathy-tp-call.c | 27 |
1 files changed, 8 insertions, 19 deletions
diff --git a/libempathy/empathy-tp-call.c b/libempathy/empathy-tp-call.c index afc6ff657..d218fd8ef 100644 --- a/libempathy/empathy-tp-call.c +++ b/libempathy/empathy-tp-call.c @@ -392,7 +392,6 @@ static void tp_call_is_ready (EmpathyTpCall *call) { EmpathyTpCallPriv *priv = GET_PRIV (call); - EmpathyContact *self_contact; GList *members; GList *local_pendings; GList *remote_pendings; @@ -404,13 +403,11 @@ tp_call_is_ready (EmpathyTpCall *call) if (!members) return; - self_contact = empathy_tp_group_get_self_contact (priv->group); local_pendings = empathy_tp_group_get_local_pendings (priv->group); remote_pendings = empathy_tp_group_get_remote_pendings (priv->group); if (local_pendings && - empathy_contact_equal (EMPATHY_CONTACT (((EmpathyPendingInfo *) - local_pendings->data)->member), self_contact)) + empathy_contact_is_user (((EmpathyPendingInfo *) local_pendings->data)->member)) { empathy_debug (DEBUG_DOMAIN, "Incoming call is ready - %p", @@ -418,8 +415,7 @@ tp_call_is_ready (EmpathyTpCall *call) priv->is_incoming = TRUE; priv->contact = g_object_ref (members->data); } - else if (remote_pendings && - empathy_contact_equal (EMPATHY_CONTACT (members->data), self_contact)) + else if (remote_pendings && empathy_contact_is_user (members->data)) { empathy_debug (DEBUG_DOMAIN, "Outgoing call is ready - %p", remote_pendings->data); @@ -428,7 +424,6 @@ tp_call_is_ready (EmpathyTpCall *call) tp_call_request_streams (call); } - g_object_unref (self_contact); g_list_foreach (members, (GFunc) g_object_unref, NULL); g_list_free (members); g_list_foreach (local_pendings, (GFunc) empathy_pending_info_free, NULL); @@ -458,10 +453,8 @@ tp_call_member_added_cb (EmpathyTpGroup *group, if (priv->status == EMPATHY_TP_CALL_STATUS_PENDING) { - if ((priv->is_incoming && - !empathy_contact_equal (contact, priv->contact)) - || (!priv->is_incoming && - empathy_contact_equal (contact, priv->contact))) + if ((priv->is_incoming && contact != priv->contact) || + (!priv->is_incoming && contact == priv->contact)) { priv->status = EMPATHY_TP_CALL_STATUS_ACCEPTED; g_signal_emit (call, signals[STATUS_CHANGED_SIGNAL], 0); @@ -831,17 +824,13 @@ void empathy_tp_call_accept_incoming_call (EmpathyTpCall *call) { EmpathyTpCallPriv *priv = GET_PRIV (call); - GList *local_pendings; + EmpathyContact *self_contact; empathy_debug (DEBUG_DOMAIN, "Accepting incoming call"); - local_pendings = empathy_tp_group_get_local_pendings (priv->group); - - empathy_tp_group_add_member (priv->group, EMPATHY_CONTACT - (((EmpathyPendingInfo *) local_pendings->data)->member), NULL); - - g_list_foreach (local_pendings, (GFunc) empathy_pending_info_free, NULL); - g_list_free (local_pendings); + self_contact = empathy_tp_group_get_self_contact (priv->group); + empathy_tp_group_add_member (priv->group, self_contact, NULL); + g_object_unref (self_contact); } void |