changeset 2519:353880a5c363

component file sharing: fixed hash handling (key has been renamed to "file_hash")
author Goffi <goffi@goffi.org>
date Wed, 14 Mar 2018 08:08:42 +0100
parents e4de2f16a284
children 25e16729413b
files src/plugins/plugin_comp_file_sharing.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/plugins/plugin_comp_file_sharing.py	Wed Mar 14 08:07:24 2018 +0100
+++ b/src/plugins/plugin_comp_file_sharing.py	Wed Mar 14 08:08:42 2018 +0100
@@ -140,7 +140,7 @@
             found_files = yield self.host.memory.getFiles(client,
                                                           peer_jid=peer_jid,
                                                           name=file_data.get(u'name'),
-                                                          file_hash=file_data.get(u'hash'),
+                                                          file_hash=file_data.get(u'file_hash'),
                                                           hash_algo=file_data.get(u'hash_algo'),
                                                           path=file_data.get(u'path'),
                                                           namespace=file_data.get(u'namespace'))
@@ -157,7 +157,7 @@
 
         # we only use the first found file
         found_file = found_files[0]
-        file_hash = found_file[u'hash']
+        file_hash = found_file[u'file_hash']
         file_path = os.path.join(self.files_path, file_hash)
         file_data[u'hash_hasher'] = hasher = self._h.getHasher(found_file[u'hash_algo'])
         size = file_data[u'size'] = found_file[u'size']