summaryrefslogtreecommitdiff
path: root/protocols/Tox/src/tox_core.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/Tox/src/tox_core.cpp')
-rw-r--r--protocols/Tox/src/tox_core.cpp30
1 files changed, 7 insertions, 23 deletions
diff --git a/protocols/Tox/src/tox_core.cpp b/protocols/Tox/src/tox_core.cpp
index 929c0c2536..225e04b7df 100644
--- a/protocols/Tox/src/tox_core.cpp
+++ b/protocols/Tox/src/tox_core.cpp
@@ -41,7 +41,7 @@ Tox_Options* CToxProto::GetToxOptions()
return options;
}
-bool CToxProto::InitToxCore(ToxThreadData *toxThread)
+bool CToxProto::InitToxCore(CToxThread *toxThread)
{
logger->Log(__FUNCTION__": initializing tox core");
@@ -112,34 +112,18 @@ bool CToxProto::InitToxCore(ToxThreadData *toxThread)
return false;
}
-void CToxProto::UninitToxCore(ToxThreadData *toxThread)
+void CToxProto::UninitToxCore()
{
+ if (toxThread->toxAv)
+ toxav_kill(toxThread->toxAv);
+
if (toxThread->tox)
{
- 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);
- }
-
- //if (IsToxCoreInited())
- //{
- // ptrA nickname(mir_utf8encodeW(ptrT(getTStringA("Nick"))));
- // tox_set_name(tox, (uint8_t*)(char*)nickname, mir_strlen(nickname));
-
- // //temporary
- // ptrA statusmes(mir_utf8encodeW(ptrT(getTStringA("StatusMsg"))));
- // tox_set_status_message(tox, (uint8_t*)(char*)statusmes, mir_strlen(statusmes));
- //}
-
- if (toxThread->toxAv)
- toxav_kill(toxThread->toxAv);
+ CancelAllTransfers();
SaveToxProfile();
tox_kill(toxThread->tox);
- toxThread = NULL;
+ this->toxThread = NULL;
}
} \ No newline at end of file