summaryrefslogtreecommitdiff
path: root/protocols/Tox/src/tox_contacts.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/Tox/src/tox_contacts.cpp')
-rw-r--r--protocols/Tox/src/tox_contacts.cpp21
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);
}
}
}