summaryrefslogtreecommitdiff
path: root/protocols/Tox/src/tox_contacts.cpp
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2015-05-07 19:15:57 +0000
committerAlexander Lantsev <aunsane@gmail.com>2015-05-07 19:15:57 +0000
commit7e78293fcbabc945a8a9e5bcaab121fbbf697c4c (patch)
tree68a371d8f9b8ca5604ce5359e681f9461a956c71 /protocols/Tox/src/tox_contacts.cpp
parent81c987f5b850447389b2621037a364c3fcb0ba73 (diff)
Tox: fixed avatar work
git-svn-id: http://svn.miranda-ng.org/main/trunk@13480 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Tox/src/tox_contacts.cpp')
-rw-r--r--protocols/Tox/src/tox_contacts.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/protocols/Tox/src/tox_contacts.cpp b/protocols/Tox/src/tox_contacts.cpp
index 2c410f4cad..2e123ca6a3 100644
--- a/protocols/Tox/src/tox_contacts.cpp
+++ b/protocols/Tox/src/tox_contacts.cpp
@@ -381,20 +381,21 @@ void CToxProto::OnConnectionStatusChanged(Tox*, uint32_t friendNumber, TOX_CONNE
}
TOX_ERR_FILE_SEND error;
- uint32_t fileNumber = tox_file_send(proto->tox, friendNumber, TOX_FILE_KIND_AVATAR, length, NULL, hash, TOX_HASH_LENGTH, &error);
+ uint32_t fileNumber = tox_file_send(proto->tox, friendNumber, TOX_FILE_KIND_AVATAR, length, hash, NULL, 0, &error);
if (error != TOX_ERR_FILE_SEND_OK)
{
proto->debugLogA(__FUNCTION__": failed to set new avatar");
return;
}
- FileTransferParam *transfer = new FileTransferParam(friendNumber, fileNumber, _T("avatar"), length);
+ AvatarTransferParam *transfer = new AvatarTransferParam(friendNumber, fileNumber, NULL, length);
+ memcpy(transfer->hash, hash, TOX_HASH_LENGTH);
transfer->pfts.hContact = hContact;
transfer->hFile = hFile;
proto->transfers.Add(transfer);
}
else
- tox_file_send(proto->tox, NULL, TOX_FILE_KIND_AVATAR, 0, NULL, NULL, 0, NULL);
+ tox_file_send(proto->tox, friendNumber, TOX_FILE_KIND_AVATAR, 0, NULL, NULL, 0, NULL);
}
else
{