diff options
Diffstat (limited to 'protocols/Tox/src/tox_contacts.cpp')
-rw-r--r-- | protocols/Tox/src/tox_contacts.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/protocols/Tox/src/tox_contacts.cpp b/protocols/Tox/src/tox_contacts.cpp index ddd880b631..7249bc47ab 100644 --- a/protocols/Tox/src/tox_contacts.cpp +++ b/protocols/Tox/src/tox_contacts.cpp @@ -5,7 +5,7 @@ bool CToxProto::IsProtoContact(MCONTACT hContact) return ::lstrcmpiA(::GetContactProto(hContact), m_szModuleName) == 0;
}
-MCONTACT CToxProto::GetContactByClientId(const char *clientId)
+MCONTACT CToxProto::FindContact(const char *clientId)
{
MCONTACT hContact = NULL;
@@ -25,7 +25,7 @@ MCONTACT CToxProto::GetContactByClientId(const char *clientId) MCONTACT CToxProto::AddContact(const char *clientId, const char *nick, bool isHidden)
{
- MCONTACT hContact = GetContactByClientId(clientId);
+ MCONTACT hContact = FindContact(clientId);
if (!hContact)
{
hContact = (MCONTACT)::CallService(MS_DB_CONTACT_ADD, 0, 0);
@@ -58,10 +58,11 @@ void CToxProto::LoadContactList() {
tox_get_client_id(tox, friends[i], &clientId[0]);
std::string toxId = DataToHexString(clientId);
+
tox_get_name(tox, friends[i], &username[0]);
std::string nick(username.begin(), username.end());
- AddContact(toxId.c_str(), nick.c_str());
+ MCONTACT hContact = AddContact(toxId.c_str(), nick.c_str());
}
}
}
|