From f4e9e995a043f22f61ba885f5ff78f85d9eccf82 Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Sun, 21 Sep 2014 10:14:54 +0000 Subject: Tox: fix in contact id converting git-svn-id: http://svn.miranda-ng.org/main/trunk@10539 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Tox/src/tox_contacts.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'protocols/Tox/src/tox_contacts.cpp') diff --git a/protocols/Tox/src/tox_contacts.cpp b/protocols/Tox/src/tox_contacts.cpp index 5abaaeb275..a2f6573713 100644 --- a/protocols/Tox/src/tox_contacts.cpp +++ b/protocols/Tox/src/tox_contacts.cpp @@ -50,10 +50,10 @@ bool CToxProto::IsMe(const std::string &id) MCONTACT CToxProto::FindContact(const std::string &id) { - DBVARIANT dbv; MCONTACT hContact = NULL; for (hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { + DBVARIANT dbv; if (!db_get(hContact, m_szModuleName, TOX_SETTINGS_ID, &dbv)) { std::string clientId; @@ -65,7 +65,7 @@ MCONTACT CToxProto::FindContact(const std::string &id) memcpy(&pubKey[0], dbv.pbVal, dbv.cpbVal); clientId = DataToHexString(pubKey); delSetting(hContact, TOX_SETTINGS_ID); - setString(hContact, TOX_SETTINGS_ID, id.c_str()); + setString(hContact, TOX_SETTINGS_ID, clientId.c_str()); } else if (dbv.type == DBVT_ASCIIZ) { -- cgit v1.2.3