[empathy/gnome-2-34] Cope with unexpected call channel invalidation



commit e90884d588a170b130f2f1c4faf2ff14d70bdc10
Author: Sjoerd Simons <sjoerd simons collabora co uk>
Date:   Thu Mar 17 11:35:46 2011 +0000

    Cope with unexpected call channel invalidation

 src/empathy-call-handler.c |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)
---
diff --git a/src/empathy-call-handler.c b/src/empathy-call-handler.c
index 02a5af6..a7aafad 100644
--- a/src/empathy-call-handler.c
+++ b/src/empathy-call-handler.c
@@ -168,6 +168,24 @@ on_get_contacts_cb (TpConnection *connection,
 }
 
 static void
+on_call_invalidated_cb (TpyCallChannel *call,
+    guint domain,
+    gint code,
+    gchar *message,
+    EmpathyCallHandler *self)
+{
+  EmpathyCallHandlerPriv *priv = self->priv;
+
+  if (priv->call == call)
+    {
+      /* Invalidated unexpectedly? Fake call ending */
+      g_signal_emit (self, signals[STATE_CHANGED], 0, TPY_CALL_STATE_ENDED);
+      tp_clear_object (&priv->call);
+      tp_clear_object (&priv->tfchannel);
+    }
+}
+
+static void
 on_call_state_changed_cb (TpyCallChannel *call,
   TpyCallState state,
   TpyCallFlags flags,
@@ -254,6 +272,8 @@ empathy_call_handler_set_property (GObject *object,
 
         tp_g_signal_connect_object (priv->call, "state-changed",
           G_CALLBACK (on_call_state_changed_cb), object, 0);
+        tp_g_signal_connect_object (priv->call, "invalidated",
+          G_CALLBACK (on_call_invalidated_cb), object, 0);
         break;
       case PROP_INITIAL_AUDIO:
         priv->initial_audio = g_value_get_boolean (value);



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