From 686b4e258c29a7adde96606474e81929d62976b1 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Thu, 18 Aug 2011 16:20:44 +0200 Subject: ft-handler: rely on the factory to prepare TP_CONNECTION_FEATURE_CAPABILITIES https://bugzilla.gnome.org/show_bug.cgi?id=656831 --- libempathy/empathy-ft-handler.c | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) (limited to 'libempathy/empathy-ft-handler.c') diff --git a/libempathy/empathy-ft-handler.c b/libempathy/empathy-ft-handler.c index a1ca07d8b..99b6dc85f 100644 --- a/libempathy/empathy-ft-handler.c +++ b/libempathy/empathy-ft-handler.c @@ -1083,26 +1083,24 @@ out: } static void -conn_prepared_cb (GObject *conn, - GAsyncResult *result, - gpointer user_data) +check_hashing (CallbacksData *data) { - CallbacksData *data = user_data; EmpathyFTHandler *handler = data->handler; EmpathyFTHandlerPriv *priv = GET_PRIV (handler); GError *myerr = NULL; TpCapabilities *caps; GPtrArray *classes; + TpConnection *conn; - if (!tp_proxy_prepare_finish (conn, result, &myerr)) - { - DEBUG ("Failed to prepare connection: %s", myerr->message); + conn = empathy_contact_get_connection (priv->contact); - data->callback (handler, myerr, data->user_data); + caps = tp_connection_get_capabilities (conn); + if (caps == NULL) + { + data->callback (handler, NULL, data->user_data); goto out; } - caps = tp_connection_get_capabilities (TP_CONNECTION (conn)); classes = tp_capabilities_get_channel_classes (caps); /* set whether we support hash and the type of it */ @@ -1202,14 +1200,7 @@ out: else { /* see if FT/hashing are allowed */ - TpConnection *connection; - GQuark features[] = { TP_CONNECTION_FEATURE_CAPABILITIES, 0 }; - - connection = empathy_contact_get_connection (priv->contact); - g_assert (connection != NULL); - - tp_proxy_prepare_async (connection, features, - conn_prepared_cb, cb_data); + check_hashing (cb_data); } } -- cgit v1.2.3