summaryrefslogtreecommitdiff
path: root/protocols/Tox/src/tox_services.cpp
blob: 136c7baa5b927fe381cc962167e7b915755e4be7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#include "common.h"

INT_PTR __cdecl 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_set_name(tox, (uint8_t*)(char*)ptrA(mir_utf8encodeT(nickname)), mir_tstrlen(nickname));
	}
	return 0;
}