CallWindow: correctly detect outgoing calls
authorEmilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>
Fri, 3 Jun 2011 10:30:07 +0000 (11:30 +0100)
committerEmilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>
Mon, 5 Sep 2011 14:20:50 +0000 (15:20 +0100)
src/empathy-call-window.c

index ccec9f628c9243c38a18b8de46bca436f16a0830..05f63e2f6813197bd3fa569e4b3fb96cbf21c03d 100644 (file)
@@ -1993,13 +1993,14 @@ empathy_call_window_constructed (GObject *object)
   EmpathyCallWindow *self = EMPATHY_CALL_WINDOW (object);
   EmpathyCallWindowPriv *priv = GET_PRIV (self);
   TpyCallChannel *call;
+  TpyCallState state;
 
   g_assert (priv->handler != NULL);
 
   g_object_get (priv->handler, "call-channel", &call, NULL);
-  priv->outgoing = (call == NULL);
-  if (call != NULL)
-    g_object_unref (call);
+  state = tpy_call_channel_get_state (call, NULL, NULL);
+  priv->outgoing = (state == TPY_CALL_STATE_PENDING_INITIATOR);
+  tp_clear_object (&call);
 
   g_object_get (priv->handler, "target-contact", &priv->contact, NULL);
   g_assert (priv->contact != NULL);