]> git.0d.be Git - empathy.git/commitdiff
call-handler: also accept outgoing calls immediately
authorDanielle Madeley <danielle.madeley@collabora.co.uk>
Fri, 13 Jan 2012 02:15:46 +0000 (13:15 +1100)
committerDanielle Madeley <danielle.madeley@collabora.co.uk>
Fri, 13 Jan 2012 02:15:46 +0000 (13:15 +1100)
Outgoing calls are in PENDING_INITIATOR until you accept them, So
Empathy would never actually start dialing an outgoing call until you
redialled and it got picked up by the other codepath, which accepts
immediately.

src/empathy-call-handler.c

index 703ed3299b74f0a25981dca1a1689c7fb1e2aae5..3389c83747685978bddd74725f69a58f35e51bd4 100644 (file)
@@ -911,11 +911,22 @@ empathy_call_handler_start_call (EmpathyCallHandler *handler,
     {
       empathy_call_handler_start_tpfs (handler);
 
-      if (tp_call_channel_get_state (priv->call, NULL, NULL, NULL) ==
-          TP_CALL_STATE_INITIALISED)
-        tp_call_channel_accept_async (priv->call, on_call_accepted_cb, NULL);
+      if (tp_channel_get_requested (TP_CHANNEL (priv->call)))
+        {
+          /* accept outgoing channels immediately */
+          tp_call_channel_accept_async (priv->call,
+              on_call_accepted_cb, NULL);
+        }
       else
-        priv->accept_when_initialised = TRUE;
+        {
+          /* accepting incoming channels when they are INITIALISED */
+          if (tp_call_channel_get_state (priv->call, NULL, NULL, NULL) ==
+              TP_CALL_STATE_INITIALISED)
+            tp_call_channel_accept_async (priv->call,
+                on_call_accepted_cb, NULL);
+          else
+            priv->accept_when_initialised = TRUE;
+        }
 
       return;
     }