diff options
author | Alexander Lantsev <aunsane@gmail.com> | 2014-08-17 18:57:11 +0000 |
---|---|---|
committer | Alexander Lantsev <aunsane@gmail.com> | 2014-08-17 18:57:11 +0000 |
commit | 9242cbc94746fc871e71c20b6977e1bb2cfe9c3e (patch) | |
tree | 829731785ed03a9a8bf4e55a34828e0ae3edd2d2 /protocols/Tox/src/tox_contacts.cpp | |
parent | ae4baba8780a843d17e3403a618775f31f9df7f9 (diff) |
Tox:
- fixed friend names
- some fixes with profile changing
git-svn-id: http://svn.miranda-ng.org/main/trunk@10217 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Tox/src/tox_contacts.cpp')
-rw-r--r-- | protocols/Tox/src/tox_contacts.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/protocols/Tox/src/tox_contacts.cpp b/protocols/Tox/src/tox_contacts.cpp index 37a5cc1f11..ea08d4338d 100644 --- a/protocols/Tox/src/tox_contacts.cpp +++ b/protocols/Tox/src/tox_contacts.cpp @@ -105,21 +105,19 @@ void CToxProto::LoadContactList() int32_t *friends = (int32_t*)mir_alloc(count * sizeof(int32_t));
tox_get_friendlist(tox, friends, count);
std::vector<uint8_t> clientId(TOX_CLIENT_ID_SIZE);
- std::vector<uint8_t> username(TOX_MAX_NAME_LENGTH);
for (uint32_t i = 0; i < count; ++i)
{
tox_get_client_id(tox, friends[i], &clientId[0]);
std::string toxId = DataToHexString(clientId);
- debugLogA("CToxProto::SendMsg: friend id is %s", toxId.c_str());
- debugLogA("CToxProto::SendMsg: friend number is %d", friends[i]);
-
MCONTACT hContact = AddContact(toxId.c_str());
if (hContact)
{
+ int size = tox_get_name_size(tox, friends[i]);
+ std::vector<uint8_t> username(size);
tox_get_name(tox, friends[i], &username[0]);
std::string nick(username.begin(), username.end());
- setString(hContact, "Nick", nick.c_str());
+ setWString(hContact, "Nick", ptrW(Utf8DecodeW(nick.c_str())));
}
//tox_get_last_online
|