From 337601f2a1fb2691486840a45fe1be8f90374929 Mon Sep 17 00:00:00 2001 From: ingvar1995 Date: Thu, 15 Sep 2016 00:21:06 +0300 Subject: [PATCH] reconnection timeout++ and fix --- toxygen/file_transfers.py | 9 ++++++--- toxygen/profile.py | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/toxygen/file_transfers.py b/toxygen/file_transfers.py index 70501b8..5684450 100644 --- a/toxygen/file_transfers.py +++ b/toxygen/file_transfers.py @@ -78,9 +78,8 @@ class FileTransfer(QtCore.QObject): t = ((time() - self._creation_time) / percentage) * (1 - percentage) self._state_changed.signal.emit(self.state, percentage, int(t)) - def finished(self, emit=False): - if type(self) is not ReceiveAvatar or emit: - self._finished.signal.emit(self._friend_number, self._file_number) + def finished(self): + self._finished.signal.emit(self._friend_number, self._file_number) def get_file_number(self): return self._file_number @@ -342,3 +341,7 @@ class ReceiveAvatar(ReceiveTransfer): remove(avatar_path) rename(self._path, avatar_path) self.finished(True) + + def finished(self, emit=False): + if emit: + super().finished() diff --git a/toxygen/profile.py b/toxygen/profile.py index 0c3d510..e34a723 100644 --- a/toxygen/profile.py +++ b/toxygen/profile.py @@ -838,7 +838,7 @@ class Profile(contact.Contact, Singleton): def reconnect(self): if self.status is None or all(list(map(lambda x: x.status is None, self._friends))): self.reset(self._screen.reset) - QtCore.QTimer.singleShot(30000, self.reconnect) + QtCore.QTimer.singleShot(45000, self.reconnect) def close(self): for friend in self._friends: