summaryrefslogtreecommitdiff
path: root/protocols/Tox/src/tox_transfer.cpp
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2015-09-14 19:34:42 +0000
committerAlexander Lantsev <aunsane@gmail.com>2015-09-14 19:34:42 +0000
commitdda141f0798b79cfa71e78934ed1b968fcc20f53 (patch)
tree327942389d763f66201e47d49ad3253e0c0fe1d1 /protocols/Tox/src/tox_transfer.cpp
parent98a324d2fb4babc09e94a10fef819f3409477eb2 (diff)
Tox: fixed tox thread management
git-svn-id: http://svn.miranda-ng.org/main/trunk@15354 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Tox/src/tox_transfer.cpp')
-rw-r--r--protocols/Tox/src/tox_transfer.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/protocols/Tox/src/tox_transfer.cpp b/protocols/Tox/src/tox_transfer.cpp
index fb6e6f7a48..fef6258058 100644
--- a/protocols/Tox/src/tox_transfer.cpp
+++ b/protocols/Tox/src/tox_transfer.cpp
@@ -348,6 +348,17 @@ void CToxProto::ResumeIncomingTransfers(uint32_t friendNumber)
}
}
+void CToxProto::CancelAllTransfers()
+{
+ for (size_t i = 0; i < transfers.Count(); i++)
+ {
+ FileTransferParam *transfer = transfers.GetAt(i);
+ tox_file_control(toxThread->tox, transfer->friendNumber, transfer->fileNumber, TOX_FILE_CONTROL_CANCEL, NULL);
+ ProtoBroadcastAck(transfer->pfts.hContact, ACKTYPE_FILE, ACKRESULT_DENIED, (HANDLE)transfer, 0);
+ transfers.Remove(transfer);
+ }
+}
+
void CToxProto::OnFileRequest(Tox*, uint32_t friendNumber, uint32_t fileNumber, TOX_FILE_CONTROL control, void *arg)
{
CToxProto *proto = (CToxProto*)arg;