diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2011-08-18 22:20:44 +0800 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2011-08-19 15:26:26 +0800 |
commit | 686b4e258c29a7adde96606474e81929d62976b1 (patch) | |
tree | 08261a29f053708a2c68ea220eb695de163b2bb9 /libempathy | |
parent | 3370401046e7233a98afbe528e9a936fdad18b18 (diff) | |
download | gsoc2013-empathy-686b4e258c29a7adde96606474e81929d62976b1.tar gsoc2013-empathy-686b4e258c29a7adde96606474e81929d62976b1.tar.gz gsoc2013-empathy-686b4e258c29a7adde96606474e81929d62976b1.tar.bz2 gsoc2013-empathy-686b4e258c29a7adde96606474e81929d62976b1.tar.lz gsoc2013-empathy-686b4e258c29a7adde96606474e81929d62976b1.tar.xz gsoc2013-empathy-686b4e258c29a7adde96606474e81929d62976b1.tar.zst gsoc2013-empathy-686b4e258c29a7adde96606474e81929d62976b1.zip |
ft-handler: rely on the factory to prepare TP_CONNECTION_FEATURE_CAPABILITIES
https://bugzilla.gnome.org/show_bug.cgi?id=656831
Diffstat (limited to 'libempathy')
-rw-r--r-- | libempathy/empathy-ft-handler.c | 25 |
1 files changed, 8 insertions, 17 deletions
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); } } |