diff options
author | Alexander Lantsev <aunsane@gmail.com> | 2015-06-03 11:23:36 +0000 |
---|---|---|
committer | Alexander Lantsev <aunsane@gmail.com> | 2015-06-03 11:23:36 +0000 |
commit | 0d1323b8c457b055784416e658740e9db518ca63 (patch) | |
tree | 361edd0f36d3d7401526cd9c5017f1fad5224108 /protocols/Tox/src/tox_contacts.cpp | |
parent | f48a5222bd112f09e962fee0381878b06df79bfa (diff) |
Tox: more correct transfer logging
git-svn-id: http://svn.miranda-ng.org/main/trunk@13981 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Tox/src/tox_contacts.cpp')
-rw-r--r-- | protocols/Tox/src/tox_contacts.cpp | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/protocols/Tox/src/tox_contacts.cpp b/protocols/Tox/src/tox_contacts.cpp index abf80745de..532f23ab48 100644 --- a/protocols/Tox/src/tox_contacts.cpp +++ b/protocols/Tox/src/tox_contacts.cpp @@ -319,22 +319,8 @@ void CToxProto::OnConnectionStatusChanged(Tox*, uint32_t friendNumber, TOX_CONNE proto->delSetting(hContact, "Auth");
proto->delSetting(hContact, "Grant");
- // resume transfers
- for (size_t i = 0; i < proto->transfers.Count(); i++)
- {
- // only for receiving
- FileTransferParam *transfer = proto->transfers.GetAt(i);
- if (transfer->friendNumber == friendNumber && transfer->GetDirection() == 1)
- {
- proto->debugLogA(__FUNCTION__": sending ask to resume the transfer of file (%d)", transfer->fileNumber);
- TOX_ERR_FILE_CONTROL error;
- if (!tox_file_control(proto->tox, transfer->friendNumber, transfer->fileNumber, TOX_FILE_CONTROL_RESUME, &error))
- {
- proto->debugLogA(__FUNCTION__": failed to resume the transfer (%d)", error);
- tox_file_control(proto->tox, transfer->friendNumber, transfer->fileNumber, TOX_FILE_CONTROL_CANCEL, NULL);
- }
- }
- }
+ // resume incoming transfers
+ proto->ResumeIncomingTransfers(friendNumber);
// update avatar
std::tstring avatarPath = proto->GetAvatarFilePath();
@@ -381,6 +367,9 @@ void CToxProto::OnConnectionStatusChanged(Tox*, uint32_t friendNumber, TOX_CONNE {
proto->SetContactStatus(hContact, ID_STATUS_OFFLINE);
proto->setDword(hContact, "LastEventDateTS", time(NULL));
+
+ // pause outgoing transfers
+ proto->PauseOutgoingTransfers(friendNumber);
}
}
}
|