aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy
diff options
context:
space:
mode:
authorCosimo Cecchi <cosimoc@gnome.org>2009-05-18 20:55:01 +0800
committerCosimo Cecchi <cosimoc@gnome.org>2009-06-01 23:53:20 +0800
commit24c1b03b78ee231e78a52ec79eb15e2f41e80338 (patch)
treea9cf50e7307d61c4cafead3f8c2c77f06077d869 /libempathy
parent948f05b5e6b28afbfc0549efe6cc4fd55598738c (diff)
downloadgsoc2013-empathy-24c1b03b78ee231e78a52ec79eb15e2f41e80338.tar
gsoc2013-empathy-24c1b03b78ee231e78a52ec79eb15e2f41e80338.tar.gz
gsoc2013-empathy-24c1b03b78ee231e78a52ec79eb15e2f41e80338.tar.bz2
gsoc2013-empathy-24c1b03b78ee231e78a52ec79eb15e2f41e80338.tar.lz
gsoc2013-empathy-24c1b03b78ee231e78a52ec79eb15e2f41e80338.tar.xz
gsoc2013-empathy-24c1b03b78ee231e78a52ec79eb15e2f41e80338.tar.zst
gsoc2013-empathy-24c1b03b78ee231e78a52ec79eb15e2f41e80338.zip
Set use_hash according to what the CM returns
Set use_hash according to what the CM returns and not what the user would like it to be, so that clients won't be confused about whether they should connect to "hashing-started" after "transfer-done".
Diffstat (limited to 'libempathy')
-rw-r--r--libempathy/empathy-ft-handler.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/libempathy/empathy-ft-handler.c b/libempathy/empathy-ft-handler.c
index e2172bcd5..beb57b1ed 100644
--- a/libempathy/empathy-ft-handler.c
+++ b/libempathy/empathy-ft-handler.c
@@ -1277,14 +1277,25 @@ empathy_ft_handler_incoming_set_destination (EmpathyFTHandler *handler,
GFile *destination,
gboolean use_hash)
{
+ EmpathyFTHandlerPriv *priv;
+
DEBUG ("Set incoming destination, use hash %s",
use_hash ? "True" : "False");
g_return_if_fail (EMPATHY_IS_FT_HANDLER (handler));
g_return_if_fail (G_IS_FILE (destination));
+ priv = GET_PRIV (handler);
+
g_object_set (handler, "gfile", destination,
"use-hash", use_hash, NULL);
+
+ /* check if hash is really supported. if it isn't, set use_hash to FALSE
+ * anyway, so that clients won't be expecting us to checksum.
+ */
+ if (EMP_STR_EMPTY (priv->content_hash) ||
+ priv->content_hash_type == TP_FILE_HASH_TYPE_NONE)
+ priv->use_hash = FALSE;
}
/**