summaryrefslogtreecommitdiff
path: root/protocols/Tox
diff options
context:
space:
mode:
authoraunsane <aunsane@gmail.com>2017-03-02 22:45:54 +0300
committeraunsane <aunsane@gmail.com>2017-03-02 22:45:54 +0300
commit403de4add1193c54e6b4387485fd8eab0c3c00bb (patch)
treeba70989f7baa52c6858b26c82717164bac62795c /protocols/Tox
parent47873187548840ecfe712bd227a2c792277d5f21 (diff)
Tox: more logs to #720
Diffstat (limited to 'protocols/Tox')
-rw-r--r--protocols/Tox/src/tox_avatars.cpp4
-rw-r--r--protocols/Tox/src/tox_contacts.cpp5
-rw-r--r--protocols/Tox/src/tox_transfer.cpp3
3 files changed, 11 insertions, 1 deletions
diff --git a/protocols/Tox/src/tox_avatars.cpp b/protocols/Tox/src/tox_avatars.cpp
index 76b59165c1..3c3bcbaaeb 100644
--- a/protocols/Tox/src/tox_avatars.cpp
+++ b/protocols/Tox/src/tox_avatars.cpp
@@ -82,6 +82,8 @@ void CToxProto::SetToxAvatar(const wchar_t* path)
return;
}
+ debugLogA(__FUNCTION__": send avatar to friend (%d)", friendNumber);
+
TOX_ERR_FILE_SEND error;
uint32_t fileNumber = tox_file_send(toxThread->Tox(), friendNumber, TOX_FILE_KIND_AVATAR, length, hash, NULL, 0, &error);
if (error != TOX_ERR_FILE_SEND_OK)
@@ -184,6 +186,8 @@ INT_PTR CToxProto::SetMyAvatar(WPARAM, LPARAM lParam)
if (friendNumber == UINT32_MAX)
continue;
+ debugLogA(__FUNCTION__": unset avatar for friend (%d)", friendNumber);
+
TOX_ERR_FILE_SEND error;
tox_file_send(toxThread->Tox(), friendNumber, TOX_FILE_KIND_AVATAR, 0, NULL, NULL, 0, &error);
if (error != TOX_ERR_FILE_SEND_OK)
diff --git a/protocols/Tox/src/tox_contacts.cpp b/protocols/Tox/src/tox_contacts.cpp
index d24da12812..a10fd03925 100644
--- a/protocols/Tox/src/tox_contacts.cpp
+++ b/protocols/Tox/src/tox_contacts.cpp
@@ -357,6 +357,8 @@ void CToxProto::OnConnectionStatusChanged(Tox*, uint32_t friendNumber, TOX_CONNE
db_free(&dbv);
}
+ proto->debugLogA(__FUNCTION__": send avatar to friend (%d)", friendNumber);
+
TOX_ERR_FILE_SEND error;
uint32_t fileNumber = tox_file_send(proto->toxThread->Tox(), friendNumber, TOX_FILE_KIND_AVATAR, length, hash, NULL, 0, &error);
if (error != TOX_ERR_FILE_SEND_OK)
@@ -374,7 +376,10 @@ void CToxProto::OnConnectionStatusChanged(Tox*, uint32_t friendNumber, TOX_CONNE
proto->transfers.Add(transfer);
}
else
+ {
+ proto->debugLogA(__FUNCTION__": unset avatar for friend (%d)", friendNumber);
tox_file_send(proto->toxThread->Tox(), friendNumber, TOX_FILE_KIND_AVATAR, 0, NULL, NULL, 0, NULL);
+ }
}
int CToxProto::OnUserInfoInit(WPARAM wParam, LPARAM lParam)
diff --git a/protocols/Tox/src/tox_transfer.cpp b/protocols/Tox/src/tox_transfer.cpp
index b66ad34d13..a85dcccc2e 100644
--- a/protocols/Tox/src/tox_transfer.cpp
+++ b/protocols/Tox/src/tox_transfer.cpp
@@ -255,9 +255,10 @@ void CToxProto::OnFileSendData(Tox*, uint32_t friendNumber, uint32_t fileNumber,
ToxHexAddress pubKey = proto->GetContactPublicKey(friendNumber);
FileTransferParam *transfer = proto->transfers.Get(friendNumber, fileNumber);
- if (transfer == NULL)
+ if (!transfer)
{
proto->debugLogA(__FUNCTION__": failed to find transfer (%d) to %s(%d)", fileNumber, (const char*)pubKey, friendNumber);
+ tox_file_control(proto->toxThread->Tox(), friendNumber, fileNumber, TOX_FILE_CONTROL_CANCEL, NULL);
return;
}