summaryrefslogtreecommitdiff
path: root/protocols/Tox/src/tox_services.cpp
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2015-04-10 12:01:55 +0000
committerAlexander Lantsev <aunsane@gmail.com>2015-04-10 12:01:55 +0000
commit78f97fe198286a120370f6c56921205191f986b0 (patch)
tree96629174df34f22697c5eaad7cfe102f8f7fd5eb /protocols/Tox/src/tox_services.cpp
parentbff791f9bd1828c66e1462a4a3f86a800b58ad13 (diff)
Tox:
- switched to new api - updated tox core git-svn-id: http://svn.miranda-ng.org/main/trunk@12726 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Tox/src/tox_services.cpp')
-rw-r--r--protocols/Tox/src/tox_services.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/protocols/Tox/src/tox_services.cpp b/protocols/Tox/src/tox_services.cpp
index 136c7baa5b..cf3d3f142f 100644
--- a/protocols/Tox/src/tox_services.cpp
+++ b/protocols/Tox/src/tox_services.cpp
@@ -1,13 +1,16 @@
#include "common.h"
-INT_PTR __cdecl CToxProto::SetMyNickname(WPARAM wParam, LPARAM lParam)
+INT_PTR CToxProto::SetMyNickname(WPARAM wParam, LPARAM lParam)
{
ptrT nickname((wParam & SMNN_UNICODE) ? mir_u2t((TCHAR*)lParam) : mir_a2t((char*)lParam));
setTString("Nick", nickname);
- if (IsToxCoreInited())
+ TOX_ERR_SET_INFO error;
+ if (!tox_self_set_name(tox, (uint8_t*)(char*)ptrA(mir_utf8encodeT(nickname)), mir_tstrlen(nickname), &error))
{
- tox_set_name(tox, (uint8_t*)(char*)ptrA(mir_utf8encodeT(nickname)), mir_tstrlen(nickname));
+ debugLogA(__FUNCTION__": failed to set nick name");
+ return 1;
}
+
return 0;
}