From 2faf4680ed7393ebf3eb587a374e5543cf627c5a Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Tue, 26 Feb 2008 13:31:23 +0000 Subject: [PATCH] Change status to closed if stream engine dies or if a call fails. svn path=/trunk/; revision=668 --- libempathy/empathy-tp-call.c | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/libempathy/empathy-tp-call.c b/libempathy/empathy-tp-call.c index 9a9ed0ba..9957d8f2 100644 --- a/libempathy/empathy-tp-call.c +++ b/libempathy/empathy-tp-call.c @@ -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)), -- 2.39.2