]> git.0d.be Git - empathy.git/commitdiff
Cope with unexpected call channel invalidation
authorSjoerd Simons <sjoerd.simons@collabora.co.uk>
Thu, 17 Mar 2011 11:35:46 +0000 (11:35 +0000)
committerEmilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>
Thu, 9 Jun 2011 09:20:07 +0000 (10:20 +0100)
src/empathy-call-handler.c

index 02a5af691edeb0794bda38665dfba04af8dbb70d..a7aafad642788b0788b657d5613db97688f707b2 100644 (file)
@@ -167,6 +167,24 @@ on_get_contacts_cb (TpConnection *connection,
   g_object_notify (G_OBJECT (self), "members");
 }
 
+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,
@@ -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);