diff options
Diffstat (limited to 'protocols/Tox/src/tox_services.cpp')
-rw-r--r-- | protocols/Tox/src/tox_services.cpp | 9 |
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;
}
|