Dont hash file on filetransfer error

This commit is contained in:
Philipp Hörist 2017-03-29 20:29:50 +02:00
parent 8c51eb72b9
commit 2ede022422
1 changed files with 3 additions and 2 deletions

View File

@ -1025,7 +1025,7 @@ class Interface:
if file_props.type_ == 'r': # we receive a file if file_props.type_ == 'r': # we receive a file
gajim.socks5queue.remove_receiver(file_props.sid, True, True) gajim.socks5queue.remove_receiver(file_props.sid, True, True)
if file_props.session_type == 'jingle': if file_props.session_type == 'jingle':
if file_props.hash_: if file_props.hash_ and file_props.error == 0:
# We compare hashes in a new thread # We compare hashes in a new thread
self.hashThread = Thread(target=self.__compare_hashes, self.hashThread = Thread(target=self.__compare_hashes,
args=(account, file_props)) args=(account, file_props))
@ -1034,7 +1034,8 @@ class Interface:
# We disn't get the hash, sender probably don't support that # We disn't get the hash, sender probably don't support that
jid = file_props.sender jid = file_props.sender
self.popup_ft_result(account, jid, file_props) self.popup_ft_result(account, jid, file_props)
ft.set_status(file_props, 'ok') if file_props.error == 0:
ft.set_status(file_props, 'ok')
session = gajim.connections[account].get_jingle_session(jid=None, session = gajim.connections[account].get_jingle_session(jid=None,
sid=file_props.sid) sid=file_props.sid)
# End jingle session # End jingle session