empathy r668 - trunk/libempathy



Author: xclaesse
Date: Tue Feb 26 13:31:23 2008
New Revision: 668
URL: http://svn.gnome.org/viewvc/empathy?rev=668&view=rev

Log:
Change status to closed if stream engine dies or if a call fails.


Modified:
   trunk/libempathy/empathy-tp-call.c

Modified: trunk/libempathy/empathy-tp-call.c
==============================================================================
--- trunk/libempathy/empathy-tp-call.c	(original)
+++ trunk/libempathy/empathy-tp-call.c	Tue Feb 26 13:31:23 2008
@@ -481,16 +481,35 @@
 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)
 {
   EmpathyTpCallPriv *priv = GET_PRIV (call);
@@ -506,6 +525,10 @@
   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)),



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]