From 9f7ed03494fa22e194e3ee553f3778d68b7ae206 Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Sat, 16 May 2015 07:36:55 +0000 Subject: Tox: attempt to fix file resuming git-svn-id: http://svn.miranda-ng.org/main/trunk@13613 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Tox/bin/x64/libtox.dll | Bin 4033135 -> 4033135 bytes protocols/Tox/bin/x64/libtox.pdb | Bin 650240 -> 650240 bytes protocols/Tox/bin/x86/libtox.dll | Bin 3372655 -> 3372655 bytes protocols/Tox/bin/x86/libtox.pdb | Bin 642048 -> 642048 bytes protocols/Tox/src/tox_contacts.cpp | 10 ---------- protocols/Tox/src/tox_transfer.cpp | 5 +++++ protocols/Tox/src/version.h | 2 +- 7 files changed, 6 insertions(+), 11 deletions(-) diff --git a/protocols/Tox/bin/x64/libtox.dll b/protocols/Tox/bin/x64/libtox.dll index df55ba49d0..5678877a99 100644 Binary files a/protocols/Tox/bin/x64/libtox.dll and b/protocols/Tox/bin/x64/libtox.dll differ diff --git a/protocols/Tox/bin/x64/libtox.pdb b/protocols/Tox/bin/x64/libtox.pdb index fadd0cbd88..7b78fbe12b 100644 Binary files a/protocols/Tox/bin/x64/libtox.pdb and b/protocols/Tox/bin/x64/libtox.pdb differ diff --git a/protocols/Tox/bin/x86/libtox.dll b/protocols/Tox/bin/x86/libtox.dll index 52001d8a5f..33fa556c57 100644 Binary files a/protocols/Tox/bin/x86/libtox.dll and b/protocols/Tox/bin/x86/libtox.dll differ diff --git a/protocols/Tox/bin/x86/libtox.pdb b/protocols/Tox/bin/x86/libtox.pdb index c11e80feb8..f3452111fd 100644 Binary files a/protocols/Tox/bin/x86/libtox.pdb and b/protocols/Tox/bin/x86/libtox.pdb differ diff --git a/protocols/Tox/src/tox_contacts.cpp b/protocols/Tox/src/tox_contacts.cpp index 0cda5f4783..311f5d0ce8 100644 --- a/protocols/Tox/src/tox_contacts.cpp +++ b/protocols/Tox/src/tox_contacts.cpp @@ -9,17 +9,13 @@ void CToxProto::SetContactStatus(MCONTACT hContact, WORD status) { WORD oldStatus = GetContactStatus(hContact); if (oldStatus != status) - { setWord(hContact, "Status", status); - } } void CToxProto::SetAllContactsStatus(WORD status) { for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) - { SetContactStatus(hContact, status); - } } MCONTACT CToxProto::GetContactFromAuthEvent(MEVENT hEvent) @@ -62,9 +58,7 @@ MCONTACT CToxProto::GetContact(const char *pubKey) ptrA contactPubKey(getStringA(hContact, TOX_SETTINGS_ID)); // check only public key part of address if (strnicmp(pubKey, contactPubKey, TOX_PUBLIC_KEY_SIZE) == 0) - { break; - } } return hContact; } @@ -80,9 +74,7 @@ MCONTACT CToxProto::AddContact(const char *address, const TCHAR *dnsId, bool isT setString(hContact, TOX_SETTINGS_ID, address); if (dnsId && mir_tstrlen(dnsId)) - { setTString(hContact, TOX_SETTINGS_DNS, dnsId); - } DBVARIANT dbv; if (!getTString(TOX_SETTINGS_GROUP, &dbv)) @@ -108,9 +100,7 @@ uint32_t CToxProto::GetToxFriendNumber(MCONTACT hContact) TOX_ERR_FRIEND_BY_PUBLIC_KEY error; uint32_t friendNumber = tox_friend_by_public_key(tox, pubKey, &error); if (error != TOX_ERR_FRIEND_BY_PUBLIC_KEY_OK) - { debugLogA(__FUNCTION__": failed to get friend number (%d)", error); - } return friendNumber; } diff --git a/protocols/Tox/src/tox_transfer.cpp b/protocols/Tox/src/tox_transfer.cpp index cc215c173e..5a1844383b 100644 --- a/protocols/Tox/src/tox_transfer.cpp +++ b/protocols/Tox/src/tox_transfer.cpp @@ -269,6 +269,11 @@ void CToxProto::OnFileSendData(Tox*, uint32_t friendNumber, uint32_t fileNumber, TOX_ERR_FILE_SEND_CHUNK error; if (!tox_file_send_chunk(proto->tox, friendNumber, fileNumber, position, data, length, &error)) { + if (error == TOX_ERR_FILE_SEND_CHUNK_FRIEND_NOT_CONNECTED) + { + mir_free(data); + return; + } proto->debugLogA(__FUNCTION__": failed to send file chunk (%d)", error); proto->ProtoBroadcastAck(transfer->pfts.hContact, ACKTYPE_FILE, ACKRESULT_FAILED, (HANDLE)transfer, 0); tox_file_control(proto->tox, transfer->friendNumber, transfer->fileNumber, TOX_FILE_CONTROL_CANCEL, NULL); diff --git a/protocols/Tox/src/version.h b/protocols/Tox/src/version.h index e6fbbb213f..5273fdb637 100644 --- a/protocols/Tox/src/version.h +++ b/protocols/Tox/src/version.h @@ -1,7 +1,7 @@ #define __MAJOR_VERSION 0 #define __MINOR_VERSION 11 #define __RELEASE_NUM 1 -#define __BUILD_NUM 2 +#define __BUILD_NUM 3 #include -- cgit v1.2.3