From 9242cbc94746fc871e71c20b6977e1bb2cfe9c3e Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Sun, 17 Aug 2014 18:57:11 +0000 Subject: 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 --- protocols/Tox/src/tox_contacts.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 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 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 clientId(TOX_CLIENT_ID_SIZE); - std::vector 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 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 -- cgit v1.2.3