summaryrefslogtreecommitdiff
path: root/protocols/Tox
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2016-07-29 12:36:34 +0000
committerGeorge Hazan <george.hazan@gmail.com>2016-07-29 12:36:34 +0000
commit428bf0cbd77813a43094cb5c984436deff251936 (patch)
treed7dfa8971153d53a849e45c942be97fe5b90b7ec /protocols/Tox
parent82ef17ca5286f58ae7af604fb9518e8dc496b7c3 (diff)
no more TCHARs
git-svn-id: http://svn.miranda-ng.org/main/trunk@17143 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Tox')
-rw-r--r--protocols/Tox/src/tox_accounts.cpp2
-rw-r--r--protocols/Tox/src/tox_avatars.cpp8
-rw-r--r--protocols/Tox/src/tox_chatrooms.cpp6
-rw-r--r--protocols/Tox/src/tox_contacts.cpp24
-rw-r--r--protocols/Tox/src/tox_core.cpp8
-rw-r--r--protocols/Tox/src/tox_dialogs.h2
-rw-r--r--protocols/Tox/src/tox_menus.cpp4
-rw-r--r--protocols/Tox/src/tox_network.cpp4
-rw-r--r--protocols/Tox/src/tox_options.cpp24
-rw-r--r--protocols/Tox/src/tox_profile.cpp8
-rw-r--r--protocols/Tox/src/tox_search.cpp2
-rw-r--r--protocols/Tox/src/tox_services.cpp2
-rw-r--r--protocols/Tox/src/tox_transfer.cpp4
-rw-r--r--protocols/Tox/src/tox_transfer.h2
14 files changed, 49 insertions, 51 deletions
diff --git a/protocols/Tox/src/tox_accounts.cpp b/protocols/Tox/src/tox_accounts.cpp
index dfdca9e4f7..f6e8f4ddd3 100644
--- a/protocols/Tox/src/tox_accounts.cpp
+++ b/protocols/Tox/src/tox_accounts.cpp
@@ -46,7 +46,7 @@ int CToxProto::OnAccountRenamed(WPARAM, LPARAM)
ptrW newPath(GetToxProfilePath());
wchar_t oldPath[MAX_PATH];
- mir_snwprintf(oldPath, MAX_PATH, L"%s\\%s.tox", VARST(L"%miranda_userdata%"), accountName);
+ mir_snwprintf(oldPath, MAX_PATH, L"%s\\%s.tox", VARSW(L"%miranda_userdata%"), accountName);
_wrename(oldPath, newPath);
mir_free(accountName);
accountName = mir_wstrdup(m_tszUserName);
diff --git a/protocols/Tox/src/tox_avatars.cpp b/protocols/Tox/src/tox_avatars.cpp
index ed0c482cda..9dfdd36b69 100644
--- a/protocols/Tox/src/tox_avatars.cpp
+++ b/protocols/Tox/src/tox_avatars.cpp
@@ -3,13 +3,13 @@
wchar_t* CToxProto::GetAvatarFilePath(MCONTACT hContact)
{
wchar_t *path = (wchar_t*)mir_calloc(MAX_PATH * sizeof(wchar_t) + 1);
- mir_snwprintf(path, MAX_PATH, L"%s\\%S", VARST(L"%miranda_avatarcache%"), m_szModuleName);
+ mir_snwprintf(path, MAX_PATH, L"%s\\%S", VARSW(L"%miranda_avatarcache%"), m_szModuleName);
DWORD dwAttributes = GetFileAttributes(path);
if (dwAttributes == 0xffffffff || (dwAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0)
- CreateDirectoryTreeT(path);
+ CreateDirectoryTreeW(path);
- ptrW address(getTStringA(hContact, TOX_SETTINGS_ID));
+ ptrW address(getWStringA(hContact, TOX_SETTINGS_ID));
if (address == NULL) {
mir_free(path);
return mir_wstrdup(L"");
@@ -231,7 +231,7 @@ void CToxProto::OnGotFriendAvatarInfo(AvatarTransferParam *transfer)
}
wchar_t path[MAX_PATH];
- mir_snwprintf(path, L"%s\\%S", VARST(L"%miranda_avatarcache%"), m_szModuleName);
+ mir_snwprintf(path, L"%s\\%S", VARSW(L"%miranda_avatarcache%"), m_szModuleName);
OnFileAllow(transfer->pfts.hContact, transfer, path);
}
diff --git a/protocols/Tox/src/tox_chatrooms.cpp b/protocols/Tox/src/tox_chatrooms.cpp
index fde562fe83..e44b337a18 100644
--- a/protocols/Tox/src/tox_chatrooms.cpp
+++ b/protocols/Tox/src/tox_chatrooms.cpp
@@ -30,12 +30,12 @@ MCONTACT CToxProto::AddChatRoom(int groupNumber)
wchar_t title[MAX_PATH];
mir_snwprintf(title, L"%s #%d", TranslateT("Group chat"), groupNumber);
- setTString(hContact, "Nick", title);
+ setWString(hContact, "Nick", title);
DBVARIANT dbv;
- if (!db_get_s(NULL, "Chat", "AddToGroup", &dbv, DBVT_TCHAR))
+ if (!db_get_s(NULL, "Chat", "AddToGroup", &dbv, DBVT_WCHAR))
{
- db_set_ts(hContact, "CList", "Group", dbv.ptszVal);
+ db_set_ws(hContact, "CList", "Group", dbv.ptszVal);
db_free(&dbv);
}
diff --git a/protocols/Tox/src/tox_contacts.cpp b/protocols/Tox/src/tox_contacts.cpp
index d3e094e0db..5abda14238 100644
--- a/protocols/Tox/src/tox_contacts.cpp
+++ b/protocols/Tox/src/tox_contacts.cpp
@@ -91,15 +91,15 @@ MCONTACT CToxProto::AddContact(const char *address, const char *nick, const char
setString(hContact, TOX_SETTINGS_ID, address);
if (mir_strlen(nick))
- setTString(hContact, "Nick", ptrW(mir_utf8decodeW(nick)));
+ setWString(hContact, "Nick", ptrW(mir_utf8decodeW(nick)));
if (mir_strlen(dnsId))
- setTString(hContact, TOX_SETTINGS_DNS, ptrW(mir_utf8decodeW(dnsId)));
+ setWString(hContact, TOX_SETTINGS_DNS, ptrW(mir_utf8decodeW(dnsId)));
DBVARIANT dbv;
- if (!getTString(TOX_SETTINGS_GROUP, &dbv))
+ if (!getWString(TOX_SETTINGS_GROUP, &dbv))
{
- db_set_ts(hContact, "CList", "Group", dbv.ptszVal);
+ db_set_ws(hContact, "CList", "Group", dbv.ptszVal);
db_free(&dbv);
}
@@ -149,7 +149,7 @@ void CToxProto::LoadFriendList(void*)
TOX_ERR_FRIEND_QUERY getNameResult;
uint8_t nick[TOX_MAX_NAME_LENGTH] = { 0 };
if (tox_friend_get_name(toxThread->Tox(), friendNumber, nick, &getNameResult))
- setTString(hContact, "Nick", ptrW(mir_utf8decodeW((char*)nick)));
+ setWString(hContact, "Nick", ptrW(mir_utf8decodeW((char*)nick)));
else
debugLogA(__FUNCTION__": failed to get friend name (%d)", getNameResult);
@@ -188,7 +188,7 @@ INT_PTR CToxProto::OnRequestAuth(WPARAM hContact, LPARAM lParam)
uint8_t nick[TOX_MAX_NAME_LENGTH] = { 0 };
TOX_ERR_FRIEND_QUERY errorFriendQuery;
if (tox_friend_get_name(toxThread->Tox(), friendNumber, nick, &errorFriendQuery))
- setTString(hContact, "Nick", ptrW(mir_utf8decodeW((char*)nick)));
+ setWString(hContact, "Nick", ptrW(mir_utf8decodeW((char*)nick)));
else
debugLogA(__FUNCTION__": failed to get friend name (%d)", errorFriendQuery);
@@ -292,7 +292,7 @@ void CToxProto::OnFriendNameChange(Tox*, uint32_t friendNumber, const uint8_t *n
rawName[length] = 0;
ptrW nickname(mir_utf8decodeW(rawName));
- proto->setTString(hContact, "Nick", nickname);
+ proto->setWString(hContact, "Nick", nickname);
}
}
@@ -307,7 +307,7 @@ void CToxProto::OnStatusMessageChanged(Tox*, uint32_t friendNumber, const uint8_
rawMessage[length] = 0;
ptrW statusMessage(mir_utf8decodeW(rawMessage));
- db_set_ts(hContact, "CList", "StatusMsg", statusMessage);
+ db_set_ws(hContact, "CList", "StatusMsg", statusMessage);
}
}
@@ -398,7 +398,7 @@ int CToxProto::OnUserInfoInit(WPARAM wParam, LPARAM lParam)
if (szProto != NULL && !mir_strcmp(szProto, m_szModuleName))
{
OPTIONSDIALOGPAGE odp = { sizeof(odp) };
- odp.flags = ODPF_TCHAR | ODPF_DONTTRANSLATE;
+ odp.flags = ODPF_UNICODE | ODPF_DONTTRANSLATE;
odp.hInstance = g_hInstance;
odp.dwInitParam = (LPARAM)this;
odp.pwszTitle = m_tszUserName;
@@ -441,7 +441,7 @@ INT_PTR CToxProto::UserInfoProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPar
break;
}
- SetDlgItemText(hwnd, IDC_DNS_ID, ptrW(proto->getTStringA(hContact, TOX_SETTINGS_DNS)));
+ SetDlgItemText(hwnd, IDC_DNS_ID, ptrW(proto->getWStringA(hContact, TOX_SETTINGS_DNS)));
}
break;
@@ -458,7 +458,7 @@ INT_PTR CToxProto::UserInfoProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPar
}
wchar_t dnsId[MAX_PATH];
GetDlgItemText(hwnd, IDC_DNS_ID, dnsId, MAX_PATH);
- proto->setTString(hContact, TOX_SETTINGS_DNS, dnsId);
+ proto->setWString(hContact, TOX_SETTINGS_DNS, dnsId);
break;
}
break;
@@ -471,8 +471,6 @@ INT_PTR CToxProto::UserInfoProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPar
SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
}
break;
-
- break;
}
return FALSE;
diff --git a/protocols/Tox/src/tox_core.cpp b/protocols/Tox/src/tox_core.cpp
index 108d9b0003..89687f69d4 100644
--- a/protocols/Tox/src/tox_core.cpp
+++ b/protocols/Tox/src/tox_core.cpp
@@ -95,9 +95,9 @@ bool CToxProto::InitToxCore(CToxThread *toxThread)
/*uint8_t nick[TOX_MAX_NAME_LENGTH] = { 0 };
tox_self_get_name(toxThread->Tox(), nick);
- setTString("Nick", ptrW(Utf8DecodeT((char*)nick)));*/
+ setWString("Nick", ptrW(Utf8DecodeT((char*)nick)));*/
- ptrA nick(mir_utf8encodeW(ptrW(getTStringA("Nick"))));
+ ptrA nick(mir_utf8encodeW(ptrW(getWStringA("Nick"))));
tox_self_set_name(toxThread->Tox(), (uint8_t*)(char*)nick, mir_strlen(nick), &error);
if (error != TOX_ERR_SET_INFO_OK)
{
@@ -107,9 +107,9 @@ bool CToxProto::InitToxCore(CToxThread *toxThread)
/*uint8_t statusMessage[TOX_MAX_STATUS_MESSAGE_LENGTH] = { 0 };
tox_self_get_status_message(toxThread->Tox(), statusMessage);
- setTString("StatusMsg", ptrW(Utf8DecodeT((char*)statusMessage)));*/
+ setWString("StatusMsg", ptrW(Utf8DecodeT((char*)statusMessage)));*/
- ptrA statusMessage(mir_utf8encodeW(ptrW(getTStringA("StatusMsg"))));
+ ptrA statusMessage(mir_utf8encodeW(ptrW(getWStringA("StatusMsg"))));
tox_self_set_status_message(toxThread->Tox(), (uint8_t*)(char*)statusMessage, mir_strlen(statusMessage), &error);
if (error != TOX_ERR_SET_INFO_OK)
{
diff --git a/protocols/Tox/src/tox_dialogs.h b/protocols/Tox/src/tox_dialogs.h
index d72c83eb92..dedd355e1b 100644
--- a/protocols/Tox/src/tox_dialogs.h
+++ b/protocols/Tox/src/tox_dialogs.h
@@ -19,7 +19,7 @@ public:
virtual void OnReset()
{
- if (GetDataType() == DBVT_TCHAR)
+ if (GetDataType() == DBVT_WCHAR)
SetText(LoadText());
else if (GetDataType() != DBVT_DELETED)
SetInt(LoadInt());
diff --git a/protocols/Tox/src/tox_menus.cpp b/protocols/Tox/src/tox_menus.cpp
index e7580ef650..61b3801928 100644
--- a/protocols/Tox/src/tox_menus.cpp
+++ b/protocols/Tox/src/tox_menus.cpp
@@ -40,7 +40,7 @@ void CToxProto::InitMenus()
HookEvent(ME_CLIST_PREBUILDCONTACTMENU, &CToxProto::PrebuildContactMenu);
CMenuItem mi;
- mi.flags = CMIF_TCHAR;
+ mi.flags = CMIF_UNICODE;
// Request authorization
SET_UID(mi, 0x36375a1f, 0xc142, 0x4d6e, 0xa6, 0x57, 0xe4, 0x76, 0x5d, 0xbc, 0x59, 0x8e);
@@ -73,7 +73,7 @@ void CToxProto::InitMenus()
int CToxProto::OnInitStatusMenu()
{
CMenuItem mi;
- mi.flags = CMIF_TCHAR;
+ mi.flags = CMIF_UNICODE;
mi.root = Menu_GetProtocolRoot(this);
// Create copy tox id command
diff --git a/protocols/Tox/src/tox_network.cpp b/protocols/Tox/src/tox_network.cpp
index 580fa31622..32a2d71298 100644
--- a/protocols/Tox/src/tox_network.cpp
+++ b/protocols/Tox/src/tox_network.cpp
@@ -66,7 +66,7 @@ void CToxProto::BootstrapNodesFromJson(CToxThread *toxThread, bool isUdp, bool i
{
ptrA json;
- VARST path(_A2W(TOX_JSON_PATH));
+ VARSW path(_A2W(TOX_JSON_PATH));
if (!IsFileExists(path))
UpdateNodes();
@@ -157,7 +157,7 @@ void CToxProto::UpdateNodes()
if (lastUpdate <= getDword("NodesUpdate", 0))
return;
- ptrW path(mir_wstrdup((wchar_t*)VARST(_A2W(TOX_JSON_PATH))));
+ ptrW path(mir_wstrdup((wchar_t*)VARSW(_A2W(TOX_JSON_PATH))));
if (!IsFileExists(path))
{
HANDLE hProfile = CreateFile(path, GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL);
diff --git a/protocols/Tox/src/tox_options.cpp b/protocols/Tox/src/tox_options.cpp
index 96564f432e..271df96825 100644
--- a/protocols/Tox/src/tox_options.cpp
+++ b/protocols/Tox/src/tox_options.cpp
@@ -90,9 +90,9 @@ void CToxOptionsMain::ProfileCreate_OnClick(CCtrlButton*)
m_toxAddress.Enable();
m_toxAddress.SetTextA(ptrA(m_proto->getStringA(TOX_SETTINGS_ID)));
- m_nickname.SetText(ptrW(m_proto->getTStringA("Nick")));
- m_password.SetText(ptrW(m_proto->getTStringA("Password")));
- m_group.SetText(ptrW(m_proto->getTStringA(TOX_SETTINGS_GROUP)));
+ m_nickname.SetText(ptrW(m_proto->getWStringA("Nick")));
+ m_password.SetText(ptrW(m_proto->getWStringA("Password")));
+ m_group.SetText(ptrW(m_proto->getWStringA(TOX_SETTINGS_GROUP)));
ShowWindow(m_profileCreate.GetHwnd(), FALSE);
ShowWindow(m_profileImport.GetHwnd(), FALSE);
@@ -144,12 +144,12 @@ void CToxOptionsMain::ProfileImport_OnClick(CCtrlButton*)
uint8_t nick[TOX_MAX_NAME_LENGTH] = { 0 };
tox_self_get_name(toxThread.Tox(), nick);
ptrW nickname(Utf8DecodeT((char*)nick));
- m_proto->setTString("Nick", nickname);
+ m_proto->setWString("Nick", nickname);
m_nickname.SetText(nickname);
uint8_t statusMessage[TOX_MAX_STATUS_MESSAGE_LENGTH] = { 0 };
tox_self_get_status_message(toxThread.Tox(), statusMessage);
- m_proto->setTString("StatusMsg", ptrW(Utf8DecodeT((char*)statusMessage)));
+ m_proto->setWString("StatusMsg", ptrW(Utf8DecodeT((char*)statusMessage)));
ShowWindow(m_profileCreate.GetHwnd(), FALSE);
ShowWindow(m_profileImport.GetHwnd(), FALSE);
@@ -195,10 +195,10 @@ void CToxOptionsMain::OnApply()
if (m_proto->IsOnline())
{
- CallProtoService(m_proto->m_szModuleName, PS_SETMYNICKNAME, SMNN_TCHAR, (LPARAM)ptrW(m_nickname.GetText()));
+ CallProtoService(m_proto->m_szModuleName, PS_SETMYNICKNAME, SMNN_UNICODE, (LPARAM)ptrW(m_nickname.GetText()));
// todo: add checkbox
- m_proto->setTString("Password", pass_ptrT(m_password.GetText()));
+ m_proto->setWString("Password", pass_ptrT(m_password.GetText()));
m_proto->SaveToxProfile(m_proto->toxThread);
}
@@ -537,7 +537,7 @@ void CToxOptionsNodeList::ReloadNodeList()
int iItem = -1;
- VARST path(_A2W(TOX_JSON_PATH));
+ VARSW path(_A2W(TOX_JSON_PATH));
if (CToxProto::IsFileExists(path))
{
ptrA json;
@@ -586,11 +586,11 @@ void CToxOptionsNodeList::ReloadNodeList()
for (int i = 0; i < nodeCount; i++)
{
mir_snprintf(setting, TOX_SETTINGS_NODE_IPV4, i);
- ptrW value(db_get_tsa(NULL, module, setting));
+ ptrW value(db_get_wsa(NULL, module, setting));
iItem = m_nodes.AddItem(value, -1, NULL, 1);
mir_snprintf(setting, TOX_SETTINGS_NODE_IPV6, i);
- value = db_get_tsa(NULL, module, setting);
+ value = db_get_wsa(NULL, module, setting);
m_nodes.SetItem(iItem, 1, value);
mir_snprintf(setting, TOX_SETTINGS_NODE_PORT, i);
@@ -603,7 +603,7 @@ void CToxOptionsNodeList::ReloadNodeList()
}
mir_snprintf(setting, TOX_SETTINGS_NODE_PKEY, i);
- value = db_get_tsa(NULL, module, setting);
+ value = db_get_wsa(NULL, module, setting);
m_nodes.SetItem(iItem, 3, value);
m_nodes.SetItem(iItem, 4, L"", 0);
@@ -681,7 +681,7 @@ int CToxProto::OnOptionsInit(WPARAM wParam, LPARAM)
{
OPTIONSDIALOGPAGE odp = { 0 };
odp.pwszTitle = m_tszUserName;
- odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR | ODPF_DONTTRANSLATE;
+ odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE | ODPF_DONTTRANSLATE;
odp.pwszGroup = LPGENW("Network");
odp.pwszTab = LPGENW("Account");
diff --git a/protocols/Tox/src/tox_profile.cpp b/protocols/Tox/src/tox_profile.cpp
index 16658bc7c6..c1d71bd40f 100644
--- a/protocols/Tox/src/tox_profile.cpp
+++ b/protocols/Tox/src/tox_profile.cpp
@@ -11,7 +11,7 @@ wchar_t* CToxProto::GetToxProfilePath(const wchar_t *accountName)
{
wchar_t *profilePath = (wchar_t*)mir_calloc(MAX_PATH * sizeof(wchar_t) + 1);
wchar_t profileRootPath[MAX_PATH];
- FoldersGetCustomPathT(hProfileFolderPath, profileRootPath, _countof(profileRootPath), VARST(L"%miranda_userdata%"));
+ FoldersGetCustomPathT(hProfileFolderPath, profileRootPath, _countof(profileRootPath), VARSW(L"%miranda_userdata%"));
mir_snwprintf(profilePath, MAX_PATH, L"%s\\%s.tox", profileRootPath, accountName);
return profilePath;
}
@@ -62,7 +62,7 @@ bool CToxProto::LoadToxProfile(Tox_Options *options)
if (tox_is_data_encrypted(data))
{
- pass_ptrA password(mir_utf8encodeW(pass_ptrT(getTStringA("Password"))));
+ pass_ptrA password(mir_utf8encodeW(pass_ptrT(getWStringA("Password"))));
if (password == NULL || mir_strlen(password) == 0)
{
CToxPasswordEditor passwordEditor(this);
@@ -108,7 +108,7 @@ void CToxProto::SaveToxProfile(CToxThread *toxThread)
uint8_t *data = (uint8_t*)mir_calloc(size + TOX_PASS_ENCRYPTION_EXTRA_LENGTH);
tox_get_savedata(toxThread->Tox(), data);
- pass_ptrA password(mir_utf8encodeW(pass_ptrT(getTStringA("Password"))));
+ pass_ptrA password(mir_utf8encodeW(pass_ptrT(getWStringA("Password"))));
if (password && mir_strlen(password))
{
TOX_ERR_ENCRYPTION coreEncryptError;
@@ -167,7 +167,7 @@ void CToxPasswordEditor::OnOk(CCtrlButton*)
{
pass_ptrT tszPassword(password.GetText());
if (savePermanently.Enabled())
- m_proto->setTString("Password", tszPassword);
+ m_proto->setWString("Password", tszPassword);
EndDialog(m_hwnd, 1);
}
diff --git a/protocols/Tox/src/tox_search.cpp b/protocols/Tox/src/tox_search.cpp
index ece71c724d..952515d60d 100644
--- a/protocols/Tox/src/tox_search.cpp
+++ b/protocols/Tox/src/tox_search.cpp
@@ -91,7 +91,7 @@ void CToxProto::SearchByNameAsync(void *arg)
/*int resolved = 0;
- if (IsFileExists((wchar_t*)VARST(_T(TOX_INI_PATH))))
+ if (IsFileExists((wchar_t*)VARSW(_T(TOX_INI_PATH))))
{
char fileName[MAX_PATH];
mir_strcpy(fileName, VARS(TOX_INI_PATH));
diff --git a/protocols/Tox/src/tox_services.cpp b/protocols/Tox/src/tox_services.cpp
index 1651bbc597..5f3db0ac89 100644
--- a/protocols/Tox/src/tox_services.cpp
+++ b/protocols/Tox/src/tox_services.cpp
@@ -3,7 +3,7 @@
INT_PTR CToxProto::SetMyNickname(WPARAM wParam, LPARAM lParam)
{
ptrW nickname((wParam & SMNN_UNICODE) ? mir_wstrdup((wchar_t*)lParam) : mir_a2u((char*)lParam));
- setTString("Nick", nickname);
+ setWString("Nick", nickname);
if (IsOnline())
{
diff --git a/protocols/Tox/src/tox_transfer.cpp b/protocols/Tox/src/tox_transfer.cpp
index 5eaf69dffe..c00cc4bf59 100644
--- a/protocols/Tox/src/tox_transfer.cpp
+++ b/protocols/Tox/src/tox_transfer.cpp
@@ -18,7 +18,7 @@ void CToxProto::OnFriendFile(Tox*, uint32_t friendNumber, uint32_t fileNumber, u
{
Netlib_Logf(proto->m_hNetlibUser, __FUNCTION__": incoming avatar (%d) from (%d)", fileNumber, friendNumber);
- ptrW address(proto->getTStringA(hContact, TOX_SETTINGS_ID));
+ ptrW address(proto->getWStringA(hContact, TOX_SETTINGS_ID));
wchar_t avatarName[MAX_PATH];
mir_snwprintf(avatarName, MAX_PATH, L"%s.png", address);
@@ -53,7 +53,7 @@ void CToxProto::OnFriendFile(Tox*, uint32_t friendNumber, uint32_t fileNumber, u
proto->transfers.Add(transfer);
PROTORECVFILET pre = { 0 };
- pre.dwFlags = PRFF_TCHAR;
+ pre.dwFlags = PRFF_UNICODE;
pre.fileCount = 1;
pre.timestamp = time(NULL);
pre.descr.w = L"";
diff --git a/protocols/Tox/src/tox_transfer.h b/protocols/Tox/src/tox_transfer.h
index af5b51d8cc..372b047fb3 100644
--- a/protocols/Tox/src/tox_transfer.h
+++ b/protocols/Tox/src/tox_transfer.h
@@ -19,7 +19,7 @@ struct FileTransferParam
transferNumber = (((int64_t)friendNumber) << 32) | ((int64_t)fileNumber);
pfts.cbSize = sizeof(PROTOFILETRANSFERSTATUS);
- pfts.flags = PFTS_TCHAR;
+ pfts.flags = PFTS_UNICODE;
pfts.hContact = NULL;
pfts.totalFiles = 1;
pfts.ptszFiles = (wchar_t**)mir_alloc(sizeof(wchar_t*)*(pfts.totalFiles + 1));