diff options
author | Alexander Lantsev <aunsane@gmail.com> | 2016-04-27 12:44:53 +0000 |
---|---|---|
committer | Alexander Lantsev <aunsane@gmail.com> | 2016-04-27 12:44:53 +0000 |
commit | 6524ac4e637dba2de42df5ca6eac4a9a5501a4d2 (patch) | |
tree | 7dcf19e3e117b2cd5479615f12425518cb7fe3d8 /protocols/Tox/src/tox_contacts.cpp | |
parent | 497a5b44f0784b488ede3e450cdb2b281c7a86d8 (diff) |
Tox:
- attempt to fix avatar hash
- some changes with toxThread
git-svn-id: http://svn.miranda-ng.org/main/trunk@16773 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Tox/src/tox_contacts.cpp')
-rw-r--r-- | protocols/Tox/src/tox_contacts.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/protocols/Tox/src/tox_contacts.cpp b/protocols/Tox/src/tox_contacts.cpp index fb0cf283a4..02a1869a37 100644 --- a/protocols/Tox/src/tox_contacts.cpp +++ b/protocols/Tox/src/tox_contacts.cpp @@ -41,7 +41,7 @@ MCONTACT CToxProto::GetContact(const int friendNumber) {
uint8_t data[TOX_PUBLIC_KEY_SIZE];
TOX_ERR_FRIEND_GET_PUBLIC_KEY error;
- if (!tox_friend_get_public_key(toxThread->tox, friendNumber, data, &error))
+ if (!tox_friend_get_public_key(toxThread->Tox(), friendNumber, data, &error))
{
logger->Log(__FUNCTION__": failed to get friend public key (%d)", error);
return NULL;
@@ -99,7 +99,7 @@ uint32_t CToxProto::GetToxFriendNumber(MCONTACT hContact) {
ToxBinAddress pubKey(ptrA(getStringA(hContact, TOX_SETTINGS_ID)));
TOX_ERR_FRIEND_BY_PUBLIC_KEY error;
- uint32_t friendNumber = tox_friend_by_public_key(toxThread->tox, pubKey.GetPubKey(), &error);
+ uint32_t friendNumber = tox_friend_by_public_key(toxThread->Tox(), pubKey.GetPubKey(), &error);
if (error != TOX_ERR_FRIEND_BY_PUBLIC_KEY_OK)
logger->Log(__FUNCTION__": failed to get friend number (%d)", error);
return friendNumber;
@@ -107,18 +107,18 @@ uint32_t CToxProto::GetToxFriendNumber(MCONTACT hContact) void CToxProto::LoadFriendList(void*)
{
- size_t count = tox_self_get_friend_list_size(toxThread->tox);
+ size_t count = tox_self_get_friend_list_size(toxThread->Tox());
if (count > 0)
{
uint32_t *friends = (uint32_t*)mir_alloc(count * sizeof(uint32_t));
- tox_self_get_friend_list(toxThread->tox, friends);
+ tox_self_get_friend_list(toxThread->Tox(), friends);
uint8_t data[TOX_PUBLIC_KEY_SIZE];
for (size_t i = 0; i < count; i++)
{
uint32_t friendNumber = friends[i];
TOX_ERR_FRIEND_GET_PUBLIC_KEY getPublicKeyResult;
- if (!tox_friend_get_public_key(toxThread->tox, friendNumber, data, &getPublicKeyResult))
+ if (!tox_friend_get_public_key(toxThread->Tox(), friendNumber, data, &getPublicKeyResult))
{
logger->Log(__FUNCTION__": failed to get friend public key (%d)", getPublicKeyResult);
continue;
@@ -132,13 +132,13 @@ void CToxProto::LoadFriendList(void*) TOX_ERR_FRIEND_QUERY getNameResult;
uint8_t nick[TOX_MAX_NAME_LENGTH] = { 0 };
- if (tox_friend_get_name(toxThread->tox, friendNumber, nick, &getNameResult))
+ if (tox_friend_get_name(toxThread->Tox(), friendNumber, nick, &getNameResult))
setTString(hContact, "Nick", ptrT(mir_utf8decodeT((char*)nick)));
else
logger->Log(__FUNCTION__": failed to get friend name (%d)", getNameResult);
TOX_ERR_FRIEND_GET_LAST_ONLINE getLastOnlineResult;
- uint64_t timestamp = tox_friend_get_last_online(toxThread->tox, friendNumber, &getLastOnlineResult);
+ uint64_t timestamp = tox_friend_get_last_online(toxThread->Tox(), friendNumber, &getLastOnlineResult);
if (getLastOnlineResult == TOX_ERR_FRIEND_GET_LAST_ONLINE_OK)
setDword(hContact, "LastEventDateTS", timestamp);
else
@@ -159,7 +159,7 @@ INT_PTR CToxProto::OnRequestAuth(WPARAM hContact, LPARAM lParam) ToxBinAddress address(ptrA(getStringA(hContact, TOX_SETTINGS_ID)));
TOX_ERR_FRIEND_ADD addFriendResult;
- int32_t friendNumber = tox_friend_add(toxThread->tox, address, (uint8_t*)reason, length, &addFriendResult);
+ int32_t friendNumber = tox_friend_add(toxThread->Tox(), address, (uint8_t*)reason, length, &addFriendResult);
if (addFriendResult != TOX_ERR_FRIEND_ADD_OK)
{
logger->Log(__FUNCTION__": failed to request auth (%d)", addFriendResult);
@@ -171,7 +171,7 @@ INT_PTR CToxProto::OnRequestAuth(WPARAM hContact, LPARAM lParam) uint8_t nick[TOX_MAX_NAME_LENGTH] = { 0 };
TOX_ERR_FRIEND_QUERY errorFriendQuery;
- if (tox_friend_get_name(toxThread->tox, friendNumber, nick, &errorFriendQuery))
+ if (tox_friend_get_name(toxThread->Tox(), friendNumber, nick, &errorFriendQuery))
setTString(hContact, "Nick", ptrT(mir_utf8decodeT((char*)nick)));
else
logger->Log(__FUNCTION__": failed to get friend name (%d)", errorFriendQuery);
@@ -186,7 +186,7 @@ INT_PTR CToxProto::OnGrantAuth(WPARAM hContact, LPARAM) ToxBinAddress pubKey(ptrA(getStringA(hContact, TOX_SETTINGS_ID)));
TOX_ERR_FRIEND_ADD error;
- tox_friend_add_norequest(toxThread->tox, pubKey, &error);
+ tox_friend_add_norequest(toxThread->Tox(), pubKey, &error);
if (error != TOX_ERR_FRIEND_ADD_OK)
{
logger->Log(__FUNCTION__": failed to grant auth (%d)", error);
@@ -210,7 +210,7 @@ int CToxProto::OnContactDeleted(MCONTACT hContact, LPARAM) {
int32_t friendNumber = GetToxFriendNumber(hContact);
TOX_ERR_FRIEND_DELETE error;
- if (!tox_friend_delete(toxThread->tox, friendNumber, &error))
+ if (!tox_friend_delete(toxThread->Tox(), friendNumber, &error))
{
logger->Log(__FUNCTION__": failed to delete friend (%d)", error);
return error;
@@ -346,7 +346,7 @@ void CToxProto::OnConnectionStatusChanged(Tox*, uint32_t friendNumber, TOX_CONNE }
TOX_ERR_FILE_SEND error;
- uint32_t fileNumber = tox_file_send(proto->toxThread->tox, friendNumber, TOX_FILE_KIND_AVATAR, length, hash, NULL, 0, &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)
{
proto->logger->Log(__FUNCTION__": failed to set new avatar");
@@ -362,7 +362,7 @@ void CToxProto::OnConnectionStatusChanged(Tox*, uint32_t friendNumber, TOX_CONNE proto->transfers.Add(transfer);
}
else
- tox_file_send(proto->toxThread->tox, friendNumber, TOX_FILE_KIND_AVATAR, 0, NULL, NULL, 0, NULL);
+ tox_file_send(proto->toxThread->Tox(), friendNumber, TOX_FILE_KIND_AVATAR, 0, NULL, NULL, 0, NULL);
}
else
{
|