diff --git a/toxygen/app.py b/toxygen/app.py index f3fd429..db3ddc8 100644 --- a/toxygen/app.py +++ b/toxygen/app.py @@ -306,6 +306,7 @@ class App: Create new tox instance (new network settings) :return: tox instance """ + self._contacts_manager.reset_contacts_statuses() self._stop_threads(False) data = self._tox.get_savedata() self._save_profile(data) diff --git a/toxygen/contacts/contacts_manager.py b/toxygen/contacts/contacts_manager.py index 08ee678..46e98a2 100644 --- a/toxygen/contacts/contacts_manager.py +++ b/toxygen/contacts/contacts_manager.py @@ -55,6 +55,14 @@ class ContactsManager(ToxSave): def is_contact_active(self, contact): return self._contacts[self._active_contact].tox_id == contact.tox_id + # ----------------------------------------------------------------------------------------------------------------- + # Reconnection support + # ----------------------------------------------------------------------------------------------------------------- + + def reset_contacts_statuses(self): + for contact in self._contacts: + contact.status = None + # ----------------------------------------------------------------------------------------------------------------- # Work with active friend # ----------------------------------------------------------------------------------------------------------------- diff --git a/toxygen/file_transfers/file_transfers_handler.py b/toxygen/file_transfers/file_transfers_handler.py index 64a2bfe..d462c89 100644 --- a/toxygen/file_transfers/file_transfers_handler.py +++ b/toxygen/file_transfers/file_transfers_handler.py @@ -254,7 +254,7 @@ class FileTransfersHandler(ToxSave): if ra.state != FILE_TRANSFER_STATE['CANCELLED']: self._file_transfers[(friend_number, file_number)] = ra ra.set_transfer_finished_handler(self.transfer_finished) - else: + elif not size: friend.reset_avatar(self._settings['identicons']) def _send_avatar_to_contacts(self):