diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2010-06-21 16:47:18 +0200 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2010-06-22 11:59:33 +0200 |
commit | 066f1c90a7e6461ccb8ea11a2f511604abbd2472 (patch) | |
tree | c468f1533938f949f44b2c863b2db576049eff63 /libempathy | |
parent | eafc9830daea1f750be9b68d7360a8b4b8345e5a (diff) | |
download | empathy-066f1c90a7e6461ccb8ea11a2f511604abbd2472.tar.gz |
tp-call: use TargetHandle to get the remote contact
Diffstat (limited to 'libempathy')
-rw-r--r-- | libempathy/empathy-tp-call.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/libempathy/empathy-tp-call.c b/libempathy/empathy-tp-call.c index 4c78649a0..9758f500b 100644 --- a/libempathy/empathy-tp-call.c +++ b/libempathy/empathy-tp-call.c @@ -278,9 +278,14 @@ tp_call_got_contact_cb (TpConnection *connection, } priv->contact = g_object_ref (contact); - priv->status = EMPATHY_TP_CALL_STATUS_PENDING; + + if (priv->status < EMPATHY_TP_CALL_STATUS_PENDING) + { + priv->status = EMPATHY_TP_CALL_STATUS_PENDING; + g_object_notify (G_OBJECT (call), "status"); + } + g_object_notify (G_OBJECT (call), "contact"); - g_object_notify (G_OBJECT (call), "status"); } static void @@ -298,16 +303,6 @@ tp_call_update_status (EmpathyTpCall *call) tp_intset_iter_init (&iter, set); while (tp_intset_iter_next (&iter)) { - if (priv->contact == NULL && iter.element != self_handle) - { - TpConnection *connection; - - /* We found the remote contact */ - connection = tp_channel_borrow_connection (priv->channel); - empathy_tp_contact_factory_get_from_handle (connection, iter.element, - tp_call_got_contact_cb, NULL, NULL, G_OBJECT (call)); - } - if (priv->status == EMPATHY_TP_CALL_STATUS_PENDING && ((priv->is_incoming && iter.element == self_handle) || (!priv->is_incoming && iter.element != self_handle))) @@ -433,6 +428,12 @@ tp_call_constructor (GType type, priv->is_incoming = !requested; + /* Get the remote contact */ + empathy_tp_contact_factory_get_from_handle ( + tp_channel_borrow_connection (priv->channel), + tp_channel_get_handle (priv->channel, NULL), tp_call_got_contact_cb, + NULL, NULL, object); + /* Update status when members changes */ tp_call_update_status (call); g_signal_connect_swapped (priv->channel, "group-members-changed", |