diff options
author | George Hazan <ghazan@miranda.im> | 2018-03-17 21:21:21 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-03-17 21:21:21 +0300 |
commit | 32ac77ea600fa6ae33fea77d2be8fdaec865da7b (patch) | |
tree | 98ddfa21b8efea8887d192008717fc2054c335a8 /protocols | |
parent | 61b9b52fcc31ff4c0a533100c15f8d4fa7b2b93a (diff) |
warning fix
Diffstat (limited to 'protocols')
-rw-r--r-- | protocols/Tox/src/tox_contacts.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/protocols/Tox/src/tox_contacts.cpp b/protocols/Tox/src/tox_contacts.cpp index a6ed84d4d7..4920e71e44 100644 --- a/protocols/Tox/src/tox_contacts.cpp +++ b/protocols/Tox/src/tox_contacts.cpp @@ -48,14 +48,13 @@ MCONTACT CToxProto::GetContact(const Tox *tox, const int friendNumber) MCONTACT CToxProto::GetContact(const char *pubKey)
{
- MCONTACT hContact = NULL;
for (auto &hContact : AccContacts()) {
ptrA contactPubKey(getStringA(hContact, TOX_SETTINGS_ID));
// check only public key part of address
if (mir_strncmpi(pubKey, contactPubKey, TOX_PUBLIC_KEY_SIZE) == 0)
- break;
+ return hContact;
}
- return hContact;
+ return 0;
}
ToxHexAddress CToxProto::GetContactPublicKey(const Tox *tox, const int friendNumber)
@@ -160,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(m_toxThread->Tox(), address, (uint8_t*)reason, length, &addFriendResult);
+ /*int32_t friendNumber = */tox_friend_add(m_toxThread->Tox(), address, (uint8_t*)reason, length, &addFriendResult);
if (addFriendResult != TOX_ERR_FRIEND_ADD_OK) {
debugLogA(__FUNCTION__": failed to request auth(%d)", addFriendResult);
return addFriendResult;
|