]> git.0d.be Git - empathy.git/commitdiff
Change status to closed if stream engine dies or if a call fails.
authorXavier Claessens <xclaesse@src.gnome.org>
Tue, 26 Feb 2008 13:31:23 +0000 (13:31 +0000)
committerXavier Claessens <xclaesse@src.gnome.org>
Tue, 26 Feb 2008 13:31:23 +0000 (13:31 +0000)
svn path=/trunk/; revision=668

libempathy/empathy-tp-call.c

index 9a9ed0babb6631b2c50e66b3e9ff8249af236d95..9957d8f25e31eca2f0174c68faf8f4e66f0a851e 100644 (file)
@@ -481,15 +481,34 @@ static void
 tp_call_async_cb (TpProxy *proxy,
                   const GError *error,
                   gpointer user_data,
-                  GObject *weak_object)
+                  GObject *call)
 {
+  EmpathyTpCallPriv *priv = GET_PRIV (call);
+
   if (error)
     {
       empathy_debug (DEBUG_DOMAIN, "Error %s: %s",
           user_data, error->message);
+      priv->status = EMPATHY_TP_CALL_STATUS_CLOSED;
+      g_signal_emit_by_name (call, "status-changed");
     }
 }
 
+static void
+tp_call_invalidated_cb (TpProxy       *stream_engine,
+                        GQuark         domain,
+                        gint           code,
+                        gchar         *message,
+                        EmpathyTpCall *call)
+{
+  EmpathyTpCallPriv *priv = GET_PRIV (call);
+
+  empathy_debug (DEBUG_DOMAIN, "Stream engine proxy invalidated: %s",
+      message);
+  priv->status = EMPATHY_TP_CALL_STATUS_CLOSED;
+  g_signal_emit_by_name (call, "status-changed");
+}
+
 static void
 tp_call_start_stream_engine (EmpathyTpCall *call)
 {
@@ -506,6 +525,10 @@ tp_call_start_stream_engine (EmpathyTpCall *call)
   tp_proxy_add_interface_by_id (priv->stream_engine,
       EMP_IFACE_QUARK_CHANNEL_HANDLER);
 
+  g_signal_connect (priv->stream_engine, "invalidated",
+      G_CALLBACK (tp_call_invalidated_cb),
+      call);
+
   emp_cli_channel_handler_call_handle_channel (priv->stream_engine, -1,
         dbus_g_proxy_get_bus_name (DBUS_G_PROXY (priv->connection)),
         dbus_g_proxy_get_path (DBUS_G_PROXY (priv->connection)),