From adcc32fc49c959b92251ac9ff773474270616ede Mon Sep 17 00:00:00 2001 From: ingvar1995 Date: Fri, 5 Aug 2016 16:38:08 +0300 Subject: [PATCH] resuming fix --- toxygen/callbacks.py | 2 +- toxygen/profile.py | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/toxygen/callbacks.py b/toxygen/callbacks.py index bfca8a4..d5b9784 100644 --- a/toxygen/callbacks.py +++ b/toxygen/callbacks.py @@ -114,7 +114,7 @@ def friend_status(tox, friend_num, new_status, user_data): if friend.status is None and Settings.get_instance()['sound_notifications'] and profile.status != TOX_USER_STATUS['BUSY']: sound_notification(SOUND_NOTIFICATION['FRIEND_CONNECTION_STATUS']) invoke_in_main_thread(friend.set_status, new_status) - invoke_in_main_thread(profile.send_files, friend_num) + invoke_in_main_thread(QtCore.QTimer.singleShot, 5000, lambda: profile.send_files(friend_num)) invoke_in_main_thread(profile.update_filtration) diff --git a/toxygen/profile.py b/toxygen/profile.py index 9f728bb..ff271d1 100644 --- a/toxygen/profile.py +++ b/toxygen/profile.py @@ -970,12 +970,7 @@ class Profile(contact.Contact, Singleton): """ self.get_friend_by_number(friend_number).update_transfer_data(file_number, TOX_FILE_TRANSFER_STATE['RUNNING']) - try: - tr = self._file_transfers[(friend_number, file_number)] - except: - print('Exception in resume:', self._file_transfers) - print(friend_number, file_number, by_friend) - return + tr = self._file_transfers[(friend_number, file_number)] if by_friend: tr.state = TOX_FILE_TRANSFER_STATE['RUNNING'] tr.signal()