summaryrefslogtreecommitdiff
path: root/protocols/Tox/src/tox_account.cpp
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2015-02-01 17:15:02 +0000
committerAlexander Lantsev <aunsane@gmail.com>2015-02-01 17:15:02 +0000
commit0a377fe6d1ca13161fc6ced1375b7926476fe44a (patch)
tree93e509d813b9bea10563ef6ddcb1430dd0d987af /protocols/Tox/src/tox_account.cpp
parent5f169b7d934be793f2a3fdb5baff3ef9b6e0f7fa (diff)
Tox: file transfer is canceled when we going to offline
git-svn-id: http://svn.miranda-ng.org/main/trunk@11976 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Tox/src/tox_account.cpp')
-rw-r--r--protocols/Tox/src/tox_account.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/protocols/Tox/src/tox_account.cpp b/protocols/Tox/src/tox_account.cpp
index 2aa3081442..49eb5fa146 100644
--- a/protocols/Tox/src/tox_account.cpp
+++ b/protocols/Tox/src/tox_account.cpp
@@ -115,6 +115,18 @@ bool CToxProto::InitToxCore()
void CToxProto::UninitToxCore()
{
+ for (size_t i = 0; i < transfers->Count(); i++)
+ {
+ FileTransferParam *transfer = transfers->GetAt(i);
+ {
+ mir_cslock(transfer->fileLock);
+
+ transfer->Cancel(tox);
+ ProtoBroadcastAck(transfer->pfts.hContact, ACKTYPE_FILE, ACKRESULT_DENIED, (HANDLE)transfer, 0);
+ }
+ transfers->Remove(transfer);
+ }
+
ptrA nickname(mir_utf8encodeW(ptrT(getTStringA("Nick"))));
tox_set_name(tox, (uint8_t*)(char*)nickname, mir_strlen(nickname));