aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy/empathy-tp-call.c
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-06-21 22:47:18 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-06-22 17:59:33 +0800
commit066f1c90a7e6461ccb8ea11a2f511604abbd2472 (patch)
treec468f1533938f949f44b2c863b2db576049eff63 /libempathy/empathy-tp-call.c
parenteafc9830daea1f750be9b68d7360a8b4b8345e5a (diff)
downloadgsoc2013-empathy-066f1c90a7e6461ccb8ea11a2f511604abbd2472.tar
gsoc2013-empathy-066f1c90a7e6461ccb8ea11a2f511604abbd2472.tar.gz
gsoc2013-empathy-066f1c90a7e6461ccb8ea11a2f511604abbd2472.tar.bz2
gsoc2013-empathy-066f1c90a7e6461ccb8ea11a2f511604abbd2472.tar.lz
gsoc2013-empathy-066f1c90a7e6461ccb8ea11a2f511604abbd2472.tar.xz
gsoc2013-empathy-066f1c90a7e6461ccb8ea11a2f511604abbd2472.tar.zst
gsoc2013-empathy-066f1c90a7e6461ccb8ea11a2f511604abbd2472.zip
tp-call: use TargetHandle to get the remote contact
Diffstat (limited to 'libempathy/empathy-tp-call.c')
-rw-r--r--libempathy/empathy-tp-call.c25
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",