summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@gmail.com>2010-07-14 11:59:21 +0200
committerXavier Claessens <xclaesse@gmail.com>2010-07-14 11:59:21 +0200
commit598cda677b2d3e956690ad9f03b82584d9797ea5 (patch)
treed37b8ef90f1cc1fc14d41cf9a5c49ee8f9daf2b5
parent50bcd648e7e01bfd0b730ffd484d0b797f036766 (diff)
Handle errors when requesting the channel
-rw-r--r--src/client.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/client.c b/src/client.c
index 3479888..6d22934 100644
--- a/src/client.c
+++ b/src/client.c
@@ -251,6 +251,22 @@ got_channel_cb (TpSimpleHandler *handler,
}
static void
+channel_request_invalidated (TpProxy *proxy,
+ guint domain,
+ gint code,
+ gchar *message,
+ gpointer user_data)
+{
+ const GError *error;
+
+ error = tp_proxy_get_invalidated (proxy);
+ if (!g_error_matches (error, TP_DBUS_ERRORS, TP_DBUS_ERROR_OBJECT_REMOVED))
+ throw_error (error);
+
+ g_object_unref (proxy);
+}
+
+static void
request_proceed_cb (TpChannelRequest *request,
const GError *error,
gpointer user_data,
@@ -286,9 +302,11 @@ create_channel_cb (TpChannelDispatcher *dispatcher,
return;
}
+ g_signal_connect (request, "invalidated",
+ G_CALLBACK (channel_request_invalidated), NULL);
+
tp_cli_channel_request_call_proceed (request, -1, request_proceed_cb,
NULL, NULL, NULL);
- g_object_unref (request);
}
typedef struct