various fixes - file transfers, friend exit callback
This commit is contained in:
parent
bcefe9bc79
commit
0b1e899931
5 changed files with 32 additions and 33 deletions
|
@ -75,27 +75,6 @@ class Profile(basecontact.BaseContact):
|
|||
|
||||
return self._tox_id
|
||||
|
||||
# -----------------------------------------------------------------------------------------------------------------
|
||||
# Friend connection status callbacks
|
||||
# -----------------------------------------------------------------------------------------------------------------
|
||||
|
||||
def friend_exit(self, friend_number):
|
||||
"""
|
||||
Friend with specified number quit
|
||||
"""
|
||||
self.get_friend_by_number(friend_number).status = None
|
||||
self.friend_typing(friend_number, False)
|
||||
if friend_number in self._call:
|
||||
self._call.finish_call(friend_number, True)
|
||||
for friend_num, file_num in list(self._file_transfers.keys()):
|
||||
if friend_num == friend_number:
|
||||
ft = self._file_transfers[(friend_num, file_num)]
|
||||
if type(ft) is SendTransfer:
|
||||
self._paused_file_transfers[ft.get_id()] = [ft.get_path(), friend_num, False, -1]
|
||||
elif type(ft) is ReceiveTransfer and ft.state != FILE_TRANSFER_STATE['INCOMING_NOT_STARTED']:
|
||||
self._paused_file_transfers[ft.get_id()] = [ft.get_path(), friend_num, True, ft.total_size()]
|
||||
self.cancel_transfer(friend_num, file_num, True)
|
||||
|
||||
# -----------------------------------------------------------------------------------------------------------------
|
||||
# Private messages
|
||||
# -----------------------------------------------------------------------------------------------------------------
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue