summaryrefslogtreecommitdiff
path: root/protocols/Tox/src/tox_services.cpp
blob: 1b5ab155a64a3dea46079d96892dfde37e24e23e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include "stdafx.h"

INT_PTR CToxProto::SetMyNickname(WPARAM wParam, LPARAM lParam)
{
	ptrT nickname((wParam & SMNN_UNICODE) ? mir_u2t((wchar_t*)lParam) : mir_a2t((char*)lParam));
	setTString("Nick", nickname);

	if (IsOnline())
	{
		T2Utf szNick8(nickname);
		TOX_ERR_SET_INFO error;
		if (!tox_self_set_name(toxThread->Tox(), szNick8, mir_strlen(szNick8), &error))
			debugLogA(__FUNCTION__": failed to set nick name");
	}

	return 0;
}