diff options
author | Alexander Lantsev <aunsane@gmail.com> | 2014-08-12 17:23:41 +0000 |
---|---|---|
committer | Alexander Lantsev <aunsane@gmail.com> | 2014-08-12 17:23:41 +0000 |
commit | c1fdf24779e15d5a1063340b35a4f7b2e3bf9d6a (patch) | |
tree | 533ad0b608c12d5d68019bc1f5a40be6522e4b95 /protocols/Tox/src/tox_contacts.cpp | |
parent | 5a5db63d2250396ea17b194e4dc7b455cdd521fd (diff) |
Tox: added message receiving
git-svn-id: http://svn.miranda-ng.org/main/trunk@10166 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
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());
}
}
}
|