diff options
Diffstat (limited to 'protocols/Tox')
-rw-r--r-- | protocols/Tox/src/stdafx.h | 1 | ||||
-rw-r--r-- | protocols/Tox/src/tox_accounts.cpp | 4 | ||||
-rw-r--r-- | protocols/Tox/src/tox_avatars.cpp | 16 | ||||
-rw-r--r-- | protocols/Tox/src/tox_chatrooms.cpp | 2 | ||||
-rw-r--r-- | protocols/Tox/src/tox_contacts.cpp | 6 | ||||
-rw-r--r-- | protocols/Tox/src/tox_icons.cpp | 12 | ||||
-rw-r--r-- | protocols/Tox/src/tox_menus.cpp | 10 | ||||
-rw-r--r-- | protocols/Tox/src/tox_multimedia.cpp | 20 | ||||
-rw-r--r-- | protocols/Tox/src/tox_multimedia.h | 2 | ||||
-rw-r--r-- | protocols/Tox/src/tox_network.cpp | 6 | ||||
-rw-r--r-- | protocols/Tox/src/tox_options.cpp | 26 | ||||
-rw-r--r-- | protocols/Tox/src/tox_profile.cpp | 12 | ||||
-rw-r--r-- | protocols/Tox/src/tox_proto.cpp | 14 | ||||
-rw-r--r-- | protocols/Tox/src/tox_proto.h | 40 | ||||
-rw-r--r-- | protocols/Tox/src/tox_search.cpp | 4 | ||||
-rw-r--r-- | protocols/Tox/src/tox_services.cpp | 2 | ||||
-rw-r--r-- | protocols/Tox/src/tox_transfer.cpp | 28 | ||||
-rw-r--r-- | protocols/Tox/src/tox_transfer.h | 12 | ||||
-rw-r--r-- | protocols/Tox/src/tox_utils.cpp | 36 |
19 files changed, 127 insertions, 126 deletions
diff --git a/protocols/Tox/src/stdafx.h b/protocols/Tox/src/stdafx.h index a2de2a5528..9f37777cc5 100644 --- a/protocols/Tox/src/stdafx.h +++ b/protocols/Tox/src/stdafx.h @@ -69,6 +69,7 @@ struct CToxProto; extern HINSTANCE g_hInstance;
#define MODULE "Tox"
+#define MODULEW L"Tox"
#define TOX_ERROR -1
diff --git a/protocols/Tox/src/tox_accounts.cpp b/protocols/Tox/src/tox_accounts.cpp index f4a2ad222d..0c4cea1a40 100644 --- a/protocols/Tox/src/tox_accounts.cpp +++ b/protocols/Tox/src/tox_accounts.cpp @@ -45,9 +45,9 @@ int CToxProto::OnAccountRenamed(WPARAM, LPARAM) mir_cslock locker(profileLock);
ptrT newPath(GetToxProfilePath());
- TCHAR oldPath[MAX_PATH];
+ wchar_t oldPath[MAX_PATH];
mir_sntprintf(oldPath, MAX_PATH, L"%s\\%s.tox", VARST(L"%miranda_userdata%"), accountName);
- _trename(oldPath, newPath);
+ _wrename(oldPath, newPath);
mir_free(accountName);
accountName = mir_tstrdup(m_tszUserName);
diff --git a/protocols/Tox/src/tox_avatars.cpp b/protocols/Tox/src/tox_avatars.cpp index b62328ae11..252f9f6a18 100644 --- a/protocols/Tox/src/tox_avatars.cpp +++ b/protocols/Tox/src/tox_avatars.cpp @@ -1,8 +1,8 @@ #include "stdafx.h"
-TCHAR* CToxProto::GetAvatarFilePath(MCONTACT hContact)
+wchar_t* CToxProto::GetAvatarFilePath(MCONTACT hContact)
{
- TCHAR *path = (TCHAR*)mir_calloc(MAX_PATH * sizeof(TCHAR) + 1);
+ wchar_t *path = (wchar_t*)mir_calloc(MAX_PATH * sizeof(wchar_t) + 1);
mir_sntprintf(path, MAX_PATH, L"%s\\%S", VARST(L"%miranda_avatarcache%"), m_szModuleName);
DWORD dwAttributes = GetFileAttributes(path);
@@ -22,9 +22,9 @@ TCHAR* CToxProto::GetAvatarFilePath(MCONTACT hContact) return path;
}
-void CToxProto::SetToxAvatar(const TCHAR* path)
+void CToxProto::SetToxAvatar(const wchar_t* path)
{
- FILE *hFile = _tfopen(path, L"rb");
+ FILE *hFile = _wfopen(path, L"rb");
if (!hFile)
{
debugLogA(__FUNCTION__": failed to open avatar file");
@@ -96,7 +96,7 @@ void CToxProto::SetToxAvatar(const TCHAR* path) transfer->pfts.flags |= PFTS_SENDING;
memcpy(transfer->hash, hash, TOX_HASH_LENGTH);
transfer->pfts.hContact = hContact;
- transfer->hFile = _tfopen(path, L"rb");
+ transfer->hFile = _wfopen(path, L"rb");
transfers.Add(transfer);
}
}
@@ -150,7 +150,7 @@ INT_PTR CToxProto::GetMyAvatar(WPARAM wParam, LPARAM lParam) {
ptrT path(GetAvatarFilePath());
if (IsFileExists(path))
- mir_tstrncpy((TCHAR*)wParam, path, (int)lParam);
+ mir_tstrncpy((wchar_t*)wParam, path, (int)lParam);
return 0;
}
@@ -158,7 +158,7 @@ INT_PTR CToxProto::GetMyAvatar(WPARAM wParam, LPARAM lParam) INT_PTR CToxProto::SetMyAvatar(WPARAM, LPARAM lParam)
{
debugLogA(__FUNCTION__": setting avatar");
- TCHAR *path = (TCHAR*)lParam;
+ wchar_t *path = (wchar_t*)lParam;
ptrT avatarPath(GetAvatarFilePath());
if (path != NULL)
{
@@ -230,7 +230,7 @@ void CToxProto::OnGotFriendAvatarInfo(AvatarTransferParam *transfer) db_free(&dbv);
}
- TCHAR path[MAX_PATH];
+ wchar_t path[MAX_PATH];
mir_sntprintf(path, L"%s\\%S", VARST(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 59580431a3..f0a538fb5c 100644 --- a/protocols/Tox/src/tox_chatrooms.cpp +++ b/protocols/Tox/src/tox_chatrooms.cpp @@ -28,7 +28,7 @@ MCONTACT CToxProto::AddChatRoom(int groupNumber) setWord(hContact, TOX_SETTINGS_CHAT_ID, groupNumber);
- TCHAR title[MAX_PATH];
+ wchar_t title[MAX_PATH];
mir_sntprintf(title, L"%s #%d", TranslateT("Group chat"), groupNumber);
setTString(hContact, "Nick", title);
diff --git a/protocols/Tox/src/tox_contacts.cpp b/protocols/Tox/src/tox_contacts.cpp index c834e43ad0..a78d6e3b39 100644 --- a/protocols/Tox/src/tox_contacts.cpp +++ b/protocols/Tox/src/tox_contacts.cpp @@ -343,7 +343,7 @@ void CToxProto::OnConnectionStatusChanged(Tox*, uint32_t friendNumber, TOX_CONNE ptrT avatarPath(proto->GetAvatarFilePath());
if (IsFileExists(avatarPath))
{
- FILE *hFile = _tfopen(avatarPath, L"rb");
+ FILE *hFile = _wfopen(avatarPath, L"rb");
if (!hFile)
{
Netlib_Logf(proto->m_hNetlibUser, __FUNCTION__": failed to open avatar file");
@@ -401,7 +401,7 @@ int CToxProto::OnUserInfoInit(WPARAM wParam, LPARAM lParam) odp.flags = ODPF_TCHAR | ODPF_DONTTRANSLATE;
odp.hInstance = g_hInstance;
odp.dwInitParam = (LPARAM)this;
- odp.ptszTitle = m_tszUserName;
+ odp.pwszTitle = m_tszUserName;
odp.pfnDlgProc = UserInfoProc;
odp.position = -2000000000;
@@ -456,7 +456,7 @@ INT_PTR CToxProto::UserInfoProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPar {
break;
}
- TCHAR dnsId[MAX_PATH];
+ wchar_t dnsId[MAX_PATH];
GetDlgItemText(hwnd, IDC_DNS_ID, dnsId, MAX_PATH);
proto->setTString(hContact, TOX_SETTINGS_DNS, dnsId);
break;
diff --git a/protocols/Tox/src/tox_icons.cpp b/protocols/Tox/src/tox_icons.cpp index 4aec68a172..083bf078c2 100644 --- a/protocols/Tox/src/tox_icons.cpp +++ b/protocols/Tox/src/tox_icons.cpp @@ -2,16 +2,16 @@ IconItemT CToxProto::Icons[] =
{
- { LPGENT("Protocol icon"), "main", IDI_TOX },
- { LPGENT("Audio call"), "audio_call", IDI_AUDIO_CALL },
- { LPGENT("Audio ring"), "audio_ring", IDI_AUDIO_RING },
- { LPGENT("Audio start"), "audio_start", IDI_AUDIO_START },
- { LPGENT("Audio end"), "audio_end", IDI_AUDIO_END },
+ { LPGENW("Protocol icon"), "main", IDI_TOX },
+ { LPGENW("Audio call"), "audio_call", IDI_AUDIO_CALL },
+ { LPGENW("Audio ring"), "audio_ring", IDI_AUDIO_RING },
+ { LPGENW("Audio start"), "audio_start", IDI_AUDIO_START },
+ { LPGENW("Audio end"), "audio_end", IDI_AUDIO_END },
};
void CToxProto::InitIcons()
{
- Icon_RegisterT(g_hInstance, LPGENT("Protocols") L"/" LPGENT(MODULE), Icons, _countof(Icons), MODULE);
+ Icon_RegisterT(g_hInstance, LPGENW("Protocols") L"/" MODULEW, Icons, _countof(Icons), MODULE);
}
HANDLE CToxProto::GetIconHandle(int iconId)
diff --git a/protocols/Tox/src/tox_menus.cpp b/protocols/Tox/src/tox_menus.cpp index 50f51fada4..e7580ef650 100644 --- a/protocols/Tox/src/tox_menus.cpp +++ b/protocols/Tox/src/tox_menus.cpp @@ -45,7 +45,7 @@ void CToxProto::InitMenus() // Request authorization
SET_UID(mi, 0x36375a1f, 0xc142, 0x4d6e, 0xa6, 0x57, 0xe4, 0x76, 0x5d, 0xbc, 0x59, 0x8e);
mi.pszService = MODULE"/RequestAuth";
- mi.name.t = LPGENT("Request authorization");
+ mi.name.w = LPGENW("Request authorization");
mi.position = CMI_POSITION + CMI_AUTH_REQUEST;
mi.hIcolibItem = ::Skin_GetIconHandle(SKINICON_AUTH_REQUEST);
ContactMenuItems[CMI_AUTH_REQUEST] = Menu_AddContactMenuItem(&mi);
@@ -54,7 +54,7 @@ void CToxProto::InitMenus() // Grant authorization
SET_UID(mi, 0x4c90452a, 0x869a, 0x4a81, 0xaf, 0xa8, 0x28, 0x34, 0xaf, 0x2b, 0x6b, 0x30);
mi.pszService = MODULE"/GrantAuth";
- mi.name.t = LPGENT("Grant authorization");
+ mi.name.w = LPGENW("Grant authorization");
mi.position = CMI_POSITION + CMI_AUTH_GRANT;
mi.hIcolibItem = ::Skin_GetIconHandle(SKINICON_AUTH_GRANT);
ContactMenuItems[CMI_AUTH_GRANT] = Menu_AddContactMenuItem(&mi);
@@ -63,7 +63,7 @@ void CToxProto::InitMenus() // Start audio call
SET_UID(mi, 0x116cb7fe, 0xce37, 0x429c, 0xb0, 0xa9, 0x7d, 0xe7, 0x70, 0x59, 0xc3, 0x95);
mi.pszService = MODULE"/Audio/Call";
- mi.name.t = LPGENT("Call");
+ mi.name.w = LPGENW("Call");
mi.position = -2000020000 + CMI_AUDIO_CALL;
mi.hIcolibItem = GetIconHandle(IDI_AUDIO_START);
ContactMenuItems[CMI_AUDIO_CALL] = Menu_AddContactMenuItem(&mi);
@@ -79,7 +79,7 @@ int CToxProto::OnInitStatusMenu() // Create copy tox id command
mi.pszService = "/CopyToxID";
CreateProtoService(mi.pszService, &CToxProto::OnCopyToxID);
- mi.name.t = LPGENT("Copy Tox ID");
+ mi.name.w = LPGENW("Copy Tox ID");
mi.position = SMI_POSITION + SMI_TOXID_COPY;
Menu_AddProtoMenuItem(&mi, m_szModuleName);
@@ -87,7 +87,7 @@ int CToxProto::OnInitStatusMenu() /*
mi.pszService = "/CreateChatRoom";
CreateProtoService(mi.pszService, &CToxProto::OnCreateChatRoom);
- mi.name.t = LPGENT("Create group chat");
+ mi.name.w = LPGENW("Create group chat");
mi.position = SMI_POSITION + SMI_GROUPCHAT_CREATE;
mi.hIcolibItem = Skin_GetIconHandle("conference");
HGENMENU hCreateChatRoom = Menu_AddProtoMenuItem(&mi, m_szModuleName);*/
diff --git a/protocols/Tox/src/tox_multimedia.cpp b/protocols/Tox/src/tox_multimedia.cpp index 48526fa19e..1238ecfda7 100644 --- a/protocols/Tox/src/tox_multimedia.cpp +++ b/protocols/Tox/src/tox_multimedia.cpp @@ -31,7 +31,7 @@ void CToxCallDlgBase::SetIcon(const char *name) Window_SetIcon_IcoLib(m_hwnd, IcoLib_GetIconHandle(iconName));
}
-void CToxCallDlgBase::SetTitle(const TCHAR *title)
+void CToxCallDlgBase::SetTitle(const wchar_t *title)
{
SetWindowText(m_hwnd, title);
}
@@ -51,10 +51,10 @@ void CToxIncomingCall::OnInitDialog() CToxCallDlgBase::OnInitDialog();
Utils_RestoreWindowPosition(m_hwnd, NULL, m_proto->m_szModuleName, "IncomingCallWindow_");
- TCHAR *nick = pcli->pfnGetContactDisplayName(hContact, 0);
+ wchar_t *nick = pcli->pfnGetContactDisplayName(hContact, 0);
from.SetText(nick);
- TCHAR title[MAX_PATH];
+ wchar_t title[MAX_PATH];
mir_sntprintf(title, TranslateT("Incoming call from %s"), nick);
SetTitle(title);
SetIcon("audio_ring");
@@ -105,10 +105,10 @@ void CToxOutgoingCall::OnInitDialog() CToxCallDlgBase::OnInitDialog();
Utils_RestoreWindowPosition(m_hwnd, NULL, m_proto->m_szModuleName, "OutgoingCallWindow_");
- TCHAR *nick = pcli->pfnGetContactDisplayName(hContact, 0);
+ wchar_t *nick = pcli->pfnGetContactDisplayName(hContact, 0);
to.SetText(nick);
- TCHAR title[MAX_PATH];
+ wchar_t title[MAX_PATH];
mir_sntprintf(title, TranslateT("Outgoing call to %s"), nick);
SetTitle(title);
SetIcon("audio_end");
@@ -147,7 +147,7 @@ void CToxOutgoingCall::OnCall(CCtrlBase*) //mir_free(cSettings);
char *message = NULL;
- TCHAR title[MAX_PATH];
+ wchar_t title[MAX_PATH];
if (GetWindowText(m_hwnd, title, _countof(title)))
message = mir_utf8encodeT(title);
else
@@ -216,7 +216,7 @@ void CToxCallDialog::OnClose() {
debugLogA(__FUNCTION__": failed to get input device caps (%d)", error);
- TCHAR errorMessage[MAX_PATH];
+ wchar_t errorMessage[MAX_PATH];
waveInGetErrorText(error, errorMessage, _countof(errorMessage));
CToxProto::ShowNotification(
TranslateT("Unable to find input audio device"),
@@ -315,7 +315,7 @@ void CToxProto::OnFriendCall(ToxAV *toxAV, uint32_t friend_number, bool audio_en return;
}
- TCHAR message[MAX_PATH];
+ wchar_t message[MAX_PATH];
mir_sntprintf(message, TranslateT("Incoming call from %s"), pcli->pfnGetContactDisplayName(hContact, 0));
T2Utf szMessage(message);
@@ -350,7 +350,7 @@ INT_PTR CToxProto::OnRecvAudioCall(WPARAM hContact, LPARAM lParam) cle.lParam = DB_EVENT_CALL;
cle.hIcon = IcoLib_GetIconByHandle(GetIconHandle(IDI_AUDIO_RING));
- TCHAR szTooltip[MAX_PATH];
+ wchar_t szTooltip[MAX_PATH];
mir_sntprintf(szTooltip, TranslateT("Incoming call from %s"), pcli->pfnGetContactDisplayName(hContact, 0));
cle.ptszTooltip = szTooltip;
@@ -520,7 +520,7 @@ static void CALLBACK ToxShowDialogApcProc(void *arg) proto->debugLogA(__FUNCTION__": failed to open audio device (%d)", error);
toxav_hangup(proto->toxThread->Tox()AV, callId);
- TCHAR errorMessage[MAX_PATH];
+ wchar_t errorMessage[MAX_PATH];
waveInGetErrorText(error, errorMessage, _countof(errorMessage));
CToxProto::ShowNotification(
TranslateT("Unable to find output audio device"),
diff --git a/protocols/Tox/src/tox_multimedia.h b/protocols/Tox/src/tox_multimedia.h index 2f3d41a93f..922b9b406f 100644 --- a/protocols/Tox/src/tox_multimedia.h +++ b/protocols/Tox/src/tox_multimedia.h @@ -14,7 +14,7 @@ protected: INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam);
void SetIcon(const char *name);
- void SetTitle(const TCHAR *title);
+ void SetTitle(const wchar_t *title);
public:
CToxCallDlgBase(CToxProto *proto, int idDialog, MCONTACT hContact);
diff --git a/protocols/Tox/src/tox_network.cpp b/protocols/Tox/src/tox_network.cpp index f4e6d887f5..c7212e780b 100644 --- a/protocols/Tox/src/tox_network.cpp +++ b/protocols/Tox/src/tox_network.cpp @@ -73,7 +73,7 @@ void CToxProto::BootstrapNodesFromJson(CToxThread *toxThread, bool isUdp, bool i if (IsFileExists(path))
{
- FILE *hFile = _tfopen(path, L"r");
+ FILE *hFile = _wfopen(path, L"r");
if (hFile != NULL)
{
_fseeki64(hFile, 0, SEEK_END);
@@ -157,7 +157,7 @@ void CToxProto::UpdateNodes() if (lastUpdate <= getDword("NodesUpdate", 0))
return;
- ptrT path(mir_tstrdup((TCHAR*)VARST(_T(TOX_JSON_PATH))));
+ ptrT path(mir_tstrdup((wchar_t*)VARST(_T(TOX_JSON_PATH))));
if (!IsFileExists(path))
{
HANDLE hProfile = CreateFile(path, GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL);
@@ -169,7 +169,7 @@ void CToxProto::UpdateNodes() CloseHandle(hProfile);
}
- FILE *hFile = _tfopen(path, L"w");
+ FILE *hFile = _wfopen(path, L"w");
if (!hFile)
{
debugLogA(__FUNCTION__": failed to open tox.json");
diff --git a/protocols/Tox/src/tox_options.cpp b/protocols/Tox/src/tox_options.cpp index 527144081b..8d65a7b0a8 100644 --- a/protocols/Tox/src/tox_options.cpp +++ b/protocols/Tox/src/tox_options.cpp @@ -104,11 +104,11 @@ void CToxOptionsMain::ProfileCreate_OnClick(CCtrlButton*) void CToxOptionsMain::ProfileImport_OnClick(CCtrlButton*)
{
- TCHAR filter[MAX_PATH];
+ wchar_t filter[MAX_PATH];
mir_sntprintf(filter, L"%s(*.tox)%c*.tox%c%s(*.*)%c*.*%c%c",
TranslateT("Tox profile"), 0, 0, TranslateT("All files"), 0, 0, 0);
- TCHAR profilePath[MAX_PATH] = { 0 };
+ wchar_t profilePath[MAX_PATH] = { 0 };
OPENFILENAME ofn = { sizeof(ofn) };
ofn.hwndOwner = m_hwnd;
@@ -162,11 +162,11 @@ void CToxOptionsMain::ProfileImport_OnClick(CCtrlButton*) void CToxOptionsMain::ProfileExport_OnClick(CCtrlButton*)
{
- TCHAR filter[MAX_PATH];
+ wchar_t filter[MAX_PATH];
mir_sntprintf(filter, L"%s(*.tox)%c*.tox%c%c",
TranslateT("Tox profile"), 0, 0, 0);
- TCHAR profilePath[MAX_PATH];
+ wchar_t profilePath[MAX_PATH];
mir_tstrncpy(profilePath, L"tox_save.tox", _countof(profilePath));
OPENFILENAME ofn = { sizeof(ofn) };
@@ -337,7 +337,7 @@ void CToxNodeEditor::OnInitDialog() lvi.mask = LVIF_TEXT;
lvi.iItem = m_iItem;
lvi.cchTextMax = MAX_PATH;
- lvi.pszText = (TCHAR*)alloca(MAX_PATH * sizeof(TCHAR));
+ lvi.pszText = (wchar_t*)alloca(MAX_PATH * sizeof(wchar_t));
lvi.iSubItem = 0;
m_list->GetItem(&lvi);
@@ -542,7 +542,7 @@ void CToxOptionsNodeList::ReloadNodeList() {
ptrA json;
- FILE *hFile = _tfopen(path, L"r");
+ FILE *hFile = _wfopen(path, L"r");
if (hFile != NULL)
{
_fseeki64(hFile, 0, SEEK_END);
@@ -614,7 +614,7 @@ void CToxOptionsNodeList::ReloadNodeList() void CToxOptionsNodeList::OnApply()
{
char setting[MAX_PATH];
- TCHAR tszText[MAX_PATH];
+ wchar_t tszText[MAX_PATH];
LVITEM lvi = { 0 };
lvi.cchTextMax = MAX_PATH;
@@ -650,7 +650,7 @@ void CToxOptionsNodeList::OnApply() lvi.iSubItem = 2;
m_nodes.GetItem(&lvi);
mir_snprintf(setting, TOX_SETTINGS_NODE_PORT, iItem);
- db_set_w(NULL, module, setting, _ttoi(lvi.pszText));
+ db_set_w(NULL, module, setting, _wtoi(lvi.pszText));
lvi.iSubItem = 3;
m_nodes.GetItem(&lvi);
@@ -680,19 +680,19 @@ void CToxOptionsNodeList::OnApply() int CToxProto::OnOptionsInit(WPARAM wParam, LPARAM)
{
OPTIONSDIALOGPAGE odp = { 0 };
- odp.ptszTitle = m_tszUserName;
+ odp.pwszTitle = m_tszUserName;
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR | ODPF_DONTTRANSLATE;
- odp.ptszGroup = LPGENT("Network");
+ odp.pwszGroup = LPGENW("Network");
- odp.ptszTab = LPGENT("Account");
+ odp.pwszTab = LPGENW("Account");
odp.pDialog = CToxOptionsMain::CreateOptionsPage(this);
Options_AddPage(wParam, &odp);
- /*odp.ptszTab = LPGENT("Multimedia");
+ /*odp.pwszTab = LPGENW("Multimedia");
odp.pDialog = CToxOptionsMultimedia::CreateOptionsPage(this);
Options_AddPage(wParam, &odp);*/
- odp.ptszTab = LPGENT("Nodes");
+ odp.pwszTab = LPGENW("Nodes");
odp.pDialog = CToxOptionsNodeList::CreateOptionsPage(this);
Options_AddPage(wParam, &odp);
diff --git a/protocols/Tox/src/tox_profile.cpp b/protocols/Tox/src/tox_profile.cpp index 8c4c49d442..32a024480d 100644 --- a/protocols/Tox/src/tox_profile.cpp +++ b/protocols/Tox/src/tox_profile.cpp @@ -2,15 +2,15 @@ HANDLE CToxProto::hProfileFolderPath;
-TCHAR* CToxProto::GetToxProfilePath()
+wchar_t* CToxProto::GetToxProfilePath()
{
return GetToxProfilePath(m_tszUserName);
}
-TCHAR* CToxProto::GetToxProfilePath(const TCHAR *accountName)
+wchar_t* CToxProto::GetToxProfilePath(const wchar_t *accountName)
{
- TCHAR *profilePath = (TCHAR*)mir_calloc(MAX_PATH * sizeof(TCHAR) + 1);
- TCHAR profileRootPath[MAX_PATH];
+ 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%"));
mir_sntprintf(profilePath, MAX_PATH, L"%s\\%s.tox", profileRootPath, accountName);
return profilePath;
@@ -26,7 +26,7 @@ bool CToxProto::LoadToxProfile(Tox_Options *options) if (!IsFileExists(profilePath))
return false;
- FILE *profile = _tfopen(profilePath, L"rb");
+ FILE *profile = _wfopen(profilePath, L"rb");
if (profile == NULL)
{
ShowNotification(TranslateT("Unable to open Tox profile"), MB_ICONERROR);
@@ -122,7 +122,7 @@ void CToxProto::SaveToxProfile(CToxThread *toxThread) }
ptrT profilePath(GetToxProfilePath());
- FILE *profile = _tfopen(profilePath, L"wb");
+ FILE *profile = _wfopen(profilePath, L"wb");
if (profile == NULL)
{
debugLogA(__FUNCTION__": failed to open tox profile");
diff --git a/protocols/Tox/src/tox_proto.cpp b/protocols/Tox/src/tox_proto.cpp index ef14dc0b0a..cf8987757d 100644 --- a/protocols/Tox/src/tox_proto.cpp +++ b/protocols/Tox/src/tox_proto.cpp @@ -1,6 +1,6 @@ #include "stdafx.h"
-CToxProto::CToxProto(const char* protoName, const TCHAR* userName)
+CToxProto::CToxProto(const char* protoName, const wchar_t* userName)
: PROTO<CToxProto>(protoName, userName),
hPollingThread(NULL), toxThread(NULL),
hOutDevice(NULL), hMessageProcess(1)
@@ -90,13 +90,13 @@ int CToxProto::AuthRecv(MCONTACT, PROTORECVEVENT* pre) return Proto_AuthRecv(m_szModuleName, pre);
}
-int CToxProto::AuthRequest(MCONTACT hContact, const TCHAR *szMessage)
+int CToxProto::AuthRequest(MCONTACT hContact, const wchar_t *szMessage)
{
ptrA reason(mir_utf8encodeW(szMessage));
return OnRequestAuth(hContact, (LPARAM)reason);
}
-HANDLE CToxProto::FileAllow(MCONTACT hContact, HANDLE hTransfer, const TCHAR *tszPath)
+HANDLE CToxProto::FileAllow(MCONTACT hContact, HANDLE hTransfer, const wchar_t *tszPath)
{
return OnFileAllow(hContact, hTransfer, tszPath);
}
@@ -106,12 +106,12 @@ int CToxProto::FileCancel(MCONTACT hContact, HANDLE hTransfer) return CancelTransfer(hContact, hTransfer);
}
-int CToxProto::FileDeny(MCONTACT hContact, HANDLE hTransfer, const TCHAR*)
+int CToxProto::FileDeny(MCONTACT hContact, HANDLE hTransfer, const wchar_t*)
{
return FileCancel(hContact, hTransfer);
}
-int CToxProto::FileResume(HANDLE hTransfer, int *action, const TCHAR **szFilename)
+int CToxProto::FileResume(HANDLE hTransfer, int *action, const wchar_t **szFilename)
{
return OnFileResume(hTransfer, action, szFilename);
}
@@ -131,7 +131,7 @@ int CToxProto::SendMsg(MCONTACT hContact, int, const char *msg) return OnSendMessage(hContact, msg);
}
-HANDLE CToxProto::SendFile(MCONTACT hContact, const TCHAR *msg, TCHAR **ppszFiles)
+HANDLE CToxProto::SendFile(MCONTACT hContact, const wchar_t *msg, wchar_t **ppszFiles)
{
return OnSendFile(hContact, msg, ppszFiles);
}
@@ -200,7 +200,7 @@ HANDLE CToxProto::GetAwayMsg(MCONTACT hContact) return 0;
}
-int CToxProto::SetAwayMsg(int, const TCHAR *msg)
+int CToxProto::SetAwayMsg(int, const wchar_t *msg)
{
if (IsOnline())
{
diff --git a/protocols/Tox/src/tox_proto.h b/protocols/Tox/src/tox_proto.h index d5bd786be9..615e713532 100644 --- a/protocols/Tox/src/tox_proto.h +++ b/protocols/Tox/src/tox_proto.h @@ -25,12 +25,12 @@ public: virtual int __cdecl Authorize(MEVENT hDbEvent);
virtual int __cdecl AuthRecv(MCONTACT hContact, PROTORECVEVENT*);
- virtual int __cdecl AuthRequest(MCONTACT hContact, const TCHAR* szMessage);
+ virtual int __cdecl AuthRequest(MCONTACT hContact, const wchar_t* szMessage);
- virtual HANDLE __cdecl FileAllow(MCONTACT hContact, HANDLE hTransfer, const TCHAR* tszPath);
+ virtual HANDLE __cdecl FileAllow(MCONTACT hContact, HANDLE hTransfer, const wchar_t* tszPath);
virtual int __cdecl FileCancel(MCONTACT hContact, HANDLE hTransfer);
- virtual int __cdecl FileDeny(MCONTACT hContact, HANDLE hTransfer, const TCHAR* tszReason);
- virtual int __cdecl FileResume(HANDLE hTransfer, int* action, const TCHAR** tszFilename);
+ virtual int __cdecl FileDeny(MCONTACT hContact, HANDLE hTransfer, const wchar_t* tszReason);
+ virtual int __cdecl FileResume(HANDLE hTransfer, int* action, const wchar_t** tszFilename);
virtual DWORD_PTR __cdecl GetCaps(int type, MCONTACT hContact = NULL);
@@ -39,19 +39,19 @@ public: virtual int __cdecl SendMsg(MCONTACT hContact, int flags, const char* msg);
- virtual HANDLE __cdecl SendFile(MCONTACT hContact, const TCHAR*, TCHAR **ppszFiles);
+ virtual HANDLE __cdecl SendFile(MCONTACT hContact, const wchar_t*, wchar_t **ppszFiles);
virtual int __cdecl SetStatus(int iNewStatus);
virtual HANDLE __cdecl GetAwayMsg(MCONTACT hContact);
- virtual int __cdecl SetAwayMsg(int iStatus, const TCHAR* msg);
+ virtual int __cdecl SetAwayMsg(int iStatus, const wchar_t* msg);
virtual int __cdecl UserIsTyping(MCONTACT hContact, int type);
virtual int __cdecl OnEvent(PROTOEVENTTYPE iEventType, WPARAM wParam, LPARAM lParam);
// accounts
- static CToxProto* InitAccount(const char *protoName, const TCHAR *userName);
+ static CToxProto* InitAccount(const char *protoName, const wchar_t *userName);
static int UninitAccount(CToxProto *proto);
// icons
@@ -68,7 +68,7 @@ public: private:
CToxThread *toxThread;
mir_cs profileLock;
- TCHAR *accountName;
+ wchar_t *accountName;
HANDLE hPollingThread;
CTransferList transfers;
ULONG hMessageProcess;
@@ -76,8 +76,8 @@ private: static HANDLE hProfileFolderPath;
// tox profile
- TCHAR* GetToxProfilePath();
- static TCHAR* GetToxProfilePath(const TCHAR *accountName);
+ wchar_t* GetToxProfilePath();
+ static wchar_t* GetToxProfilePath(const wchar_t *accountName);
bool LoadToxProfile(Tox_Options *options);
void SaveToxProfile(CToxThread *toxThread);
@@ -225,9 +225,9 @@ private: int __cdecl OnPreCreateMessage(WPARAM wParam, LPARAM lParam);
// transfer
- HANDLE OnFileAllow(MCONTACT hContact, HANDLE hTransfer, const TCHAR *tszPath);
- int OnFileResume(HANDLE hTransfer, int *action, const TCHAR **szFilename);
- HANDLE OnSendFile(MCONTACT hContact, const TCHAR*, TCHAR **ppszFiles);
+ HANDLE OnFileAllow(MCONTACT hContact, HANDLE hTransfer, const wchar_t *tszPath);
+ int OnFileResume(HANDLE hTransfer, int *action, const wchar_t **szFilename);
+ HANDLE OnSendFile(MCONTACT hContact, const wchar_t*, wchar_t **ppszFiles);
int CancelTransfer(MCONTACT hContact, HANDLE hTransfer);
@@ -244,8 +244,8 @@ private: void CancelAllTransfers(CToxThread *toxThread);
// avatars
- TCHAR* GetAvatarFilePath(MCONTACT hContact = NULL);
- void SetToxAvatar(const TCHAR* path);
+ wchar_t* GetAvatarFilePath(MCONTACT hContact = NULL);
+ void SetToxAvatar(const wchar_t* path);
INT_PTR __cdecl GetAvatarCaps(WPARAM wParam, LPARAM lParam);
INT_PTR __cdecl GetAvatarInfo(WPARAM, LPARAM lParam);
@@ -284,13 +284,13 @@ private: static TOX_USER_STATUS MirandaToToxStatus(int status);
static int ToxToMirandaStatus(TOX_USER_STATUS userstatus);
- static TCHAR* ToxErrorToString(TOX_ERR_NEW error);
- static TCHAR* ToxErrorToString(TOX_ERR_FRIEND_SEND_MESSAGE error);
+ static wchar_t* ToxErrorToString(TOX_ERR_NEW error);
+ static wchar_t* ToxErrorToString(TOX_ERR_FRIEND_SEND_MESSAGE error);
- static void ShowNotification(const TCHAR *message, int flags = 0, MCONTACT hContact = NULL);
- static void ShowNotification(const TCHAR *caption, const TCHAR *message, int flags = 0, MCONTACT hContact = NULL);
+ static void ShowNotification(const wchar_t *message, int flags = 0, MCONTACT hContact = NULL);
+ static void ShowNotification(const wchar_t *caption, const wchar_t *message, int flags = 0, MCONTACT hContact = NULL);
- static bool IsFileExists(const TCHAR* path);
+ static bool IsFileExists(const wchar_t* path);
MEVENT AddEventToDb(MCONTACT hContact, WORD type, DWORD timestamp, DWORD flags, PBYTE pBlob, size_t cbBlob);
diff --git a/protocols/Tox/src/tox_search.cpp b/protocols/Tox/src/tox_search.cpp index 197f1baaa3..ece71c724d 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((TCHAR*)VARST(_T(TOX_INI_PATH))))
+ if (IsFileExists((wchar_t*)VARST(_T(TOX_INI_PATH))))
{
char fileName[MAX_PATH];
mir_strcpy(fileName, VARS(TOX_INI_PATH));
@@ -223,7 +223,7 @@ HWND CToxProto::OnSearchAdvanced(HWND owner) std::smatch match;
std::regex regex("^\\s*([A-Fa-f0-9]{76})\\s*$");
- TCHAR text[MAX_PATH];
+ wchar_t text[MAX_PATH];
GetDlgItemText(owner, IDC_SEARCH, text, _countof(text));
const std::string query = T2Utf(text).str();
diff --git a/protocols/Tox/src/tox_services.cpp b/protocols/Tox/src/tox_services.cpp index 3875a66f47..1b5ab155a6 100644 --- a/protocols/Tox/src/tox_services.cpp +++ b/protocols/Tox/src/tox_services.cpp @@ -2,7 +2,7 @@ INT_PTR CToxProto::SetMyNickname(WPARAM wParam, LPARAM lParam)
{
- ptrT nickname((wParam & SMNN_UNICODE) ? mir_u2t((TCHAR*)lParam) : mir_a2t((char*)lParam));
+ ptrT nickname((wParam & SMNN_UNICODE) ? mir_u2t((wchar_t*)lParam) : mir_a2t((char*)lParam));
setTString("Nick", nickname);
if (IsOnline())
diff --git a/protocols/Tox/src/tox_transfer.cpp b/protocols/Tox/src/tox_transfer.cpp index e2b3286d22..d775117f70 100644 --- a/protocols/Tox/src/tox_transfer.cpp +++ b/protocols/Tox/src/tox_transfer.cpp @@ -19,7 +19,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);
ptrT address(proto->getTStringA(hContact, TOX_SETTINGS_ID));
- TCHAR avatarName[MAX_PATH];
+ wchar_t avatarName[MAX_PATH];
mir_sntprintf(avatarName, MAX_PATH, L"%s.png", address);
AvatarTransferParam *transfer = new AvatarTransferParam(friendNumber, fileNumber, avatarName, fileSize);
@@ -45,7 +45,7 @@ void CToxProto::OnFriendFile(Tox*, uint32_t friendNumber, uint32_t fileNumber, u ptrA rawName((char*)mir_alloc(filenameLength + 1));
memcpy(rawName, fileName, filenameLength);
rawName[filenameLength] = 0;
- TCHAR *name = mir_utf8decodeT(rawName);
+ wchar_t *name = mir_utf8decodeT(rawName);
FileTransferParam *transfer = new FileTransferParam(friendNumber, fileNumber, name, fileSize);
transfer->pfts.flags |= PFTS_RECEIVING;
@@ -56,8 +56,8 @@ void CToxProto::OnFriendFile(Tox*, uint32_t friendNumber, uint32_t fileNumber, u pre.dwFlags = PRFF_TCHAR;
pre.fileCount = 1;
pre.timestamp = time(NULL);
- pre.descr.t = L"";
- pre.files.t = &name;
+ pre.descr.w = L"";
+ pre.files.w = &name;
pre.lParam = (LPARAM)transfer;
ProtoChainRecvFile(hContact, &pre);
}
@@ -71,20 +71,20 @@ void CToxProto::OnFriendFile(Tox*, uint32_t friendNumber, uint32_t fileNumber, u }
// file request is allowed
-HANDLE CToxProto::OnFileAllow(MCONTACT hContact, HANDLE hTransfer, const TCHAR *tszPath)
+HANDLE CToxProto::OnFileAllow(MCONTACT hContact, HANDLE hTransfer, const wchar_t *tszPath)
{
FileTransferParam *transfer = (FileTransferParam*)hTransfer;
transfer->pfts.tszWorkingDir = mir_tstrdup(tszPath);
// stupid fix
- TCHAR fullPath[MAX_PATH];
+ wchar_t fullPath[MAX_PATH];
mir_sntprintf(fullPath, L"%s\\%s", transfer->pfts.tszWorkingDir, transfer->pfts.tszCurrentFile);
transfer->ChangeName(fullPath);
if (!ProtoBroadcastAck(hContact, ACKTYPE_FILE, ACKRESULT_FILERESUME, (HANDLE)transfer, (LPARAM)&transfer->pfts))
{
int action = FILERESUME_OVERWRITE;
- const TCHAR **szFilename = (const TCHAR**)mir_alloc(sizeof(TCHAR*) * 2);
+ const wchar_t **szFilename = (const wchar_t**)mir_alloc(sizeof(wchar_t*) * 2);
szFilename[0] = fullPath;
szFilename[1] = NULL;
OnFileResume(hTransfer, &action, szFilename);
@@ -95,7 +95,7 @@ HANDLE CToxProto::OnFileAllow(MCONTACT hContact, HANDLE hTransfer, const TCHAR * }
// if file is exists
-int CToxProto::OnFileResume(HANDLE hTransfer, int *action, const TCHAR **szFilename)
+int CToxProto::OnFileResume(HANDLE hTransfer, int *action, const wchar_t **szFilename)
{
FileTransferParam *transfer = (FileTransferParam*)hTransfer;
@@ -111,7 +111,7 @@ int CToxProto::OnFileResume(HANDLE hTransfer, int *action, const TCHAR **szFilen ToxHexAddress pubKey = GetContactPublicKey(transfer->friendNumber);
- TCHAR *mode = *action == FILERESUME_OVERWRITE ? L"wb" : L"ab";
+ wchar_t *mode = *action == FILERESUME_OVERWRITE ? L"wb" : L"ab";
if (!transfer->OpenFile(mode))
{
debugLogA(__FUNCTION__": failed to open file (%d) from %s(%d)", transfer->fileNumber, (const char*)pubKey, transfer->friendNumber);
@@ -200,23 +200,23 @@ void CToxProto::OnDataReceiving(Tox*, uint32_t friendNumber, uint32_t fileNumber /* FILE SENDING */
// outcoming file flow
-HANDLE CToxProto::OnSendFile(MCONTACT hContact, const TCHAR*, TCHAR **ppszFiles)
+HANDLE CToxProto::OnSendFile(MCONTACT hContact, const wchar_t*, wchar_t **ppszFiles)
{
int32_t friendNumber = GetToxFriendNumber(hContact);
if (friendNumber == UINT32_MAX)
return NULL;
- FILE *hFile = _tfopen(ppszFiles[0], L"rb");
+ FILE *hFile = _wfopen(ppszFiles[0], L"rb");
if (hFile == NULL)
{
debugLogA(__FUNCTION__": cannot open file %s", ppszFiles[0]);
return NULL;
}
- TCHAR *fileName = _tcsrchr(ppszFiles[0], '\\') + 1;
+ wchar_t *fileName = wcsrchr(ppszFiles[0], '\\') + 1;
size_t fileDirLength = fileName - ppszFiles[0];
- TCHAR *fileDir = (TCHAR*)mir_alloc(sizeof(TCHAR)*(fileDirLength + 1));
- _tcsncpy(fileDir, ppszFiles[0], fileDirLength);
+ wchar_t *fileDir = (wchar_t*)mir_alloc(sizeof(wchar_t)*(fileDirLength + 1));
+ wcsncpy(fileDir, ppszFiles[0], fileDirLength);
fileDir[fileDirLength] = '\0';
_fseeki64(hFile, 0, SEEK_END);
diff --git a/protocols/Tox/src/tox_transfer.h b/protocols/Tox/src/tox_transfer.h index a8dcc55b62..40f8faea75 100644 --- a/protocols/Tox/src/tox_transfer.h +++ b/protocols/Tox/src/tox_transfer.h @@ -11,7 +11,7 @@ struct FileTransferParam TOX_FILE_KIND transferType;
- FileTransferParam(uint32_t friendNumber, uint32_t fileNumber, const TCHAR *fileName, uint64_t fileSize)
+ FileTransferParam(uint32_t friendNumber, uint32_t fileNumber, const wchar_t *fileName, uint64_t fileSize)
{
hFile = NULL;
this->friendNumber = friendNumber;
@@ -22,7 +22,7 @@ struct FileTransferParam pfts.flags = PFTS_TCHAR;
pfts.hContact = NULL;
pfts.totalFiles = 1;
- pfts.ptszFiles = (TCHAR**)mir_alloc(sizeof(TCHAR*)*(pfts.totalFiles + 1));
+ pfts.ptszFiles = (wchar_t**)mir_alloc(sizeof(wchar_t*)*(pfts.totalFiles + 1));
pfts.ptszFiles[0] = pfts.tszCurrentFile = mir_tstrdup(fileName);
pfts.ptszFiles[pfts.totalFiles] = NULL;
pfts.totalBytes = pfts.currentFileSize = fileSize;
@@ -34,13 +34,13 @@ struct FileTransferParam transferType = TOX_FILE_KIND_DATA;
}
- bool OpenFile(const TCHAR *mode)
+ bool OpenFile(const wchar_t *mode)
{
- hFile = _tfopen(pfts.tszCurrentFile, mode);
+ hFile = _wfopen(pfts.tszCurrentFile, mode);
return hFile != NULL;
}
- void ChangeName(const TCHAR *fileName)
+ void ChangeName(const wchar_t *fileName)
{
pfts.ptszFiles[0] = replaceStrT(pfts.tszCurrentFile, fileName);
}
@@ -68,7 +68,7 @@ struct AvatarTransferParam : public FileTransferParam {
uint8_t hash[TOX_HASH_LENGTH];
- AvatarTransferParam(uint32_t friendNumber, uint32_t fileNumber, const TCHAR *fileName, uint64_t fileSize)
+ AvatarTransferParam(uint32_t friendNumber, uint32_t fileNumber, const wchar_t *fileName, uint64_t fileSize)
: FileTransferParam(friendNumber, fileNumber, fileName, fileSize)
{
transferType = TOX_FILE_KIND_AVATAR;
diff --git a/protocols/Tox/src/tox_utils.cpp b/protocols/Tox/src/tox_utils.cpp index 0ad5015340..f09f7ca8c1 100644 --- a/protocols/Tox/src/tox_utils.cpp +++ b/protocols/Tox/src/tox_utils.cpp @@ -55,7 +55,7 @@ int CToxProto::ToxToMirandaStatus(TOX_USER_STATUS userstatus) return status;
}
-TCHAR* CToxProto::ToxErrorToString(TOX_ERR_NEW error)
+wchar_t* CToxProto::ToxErrorToString(TOX_ERR_NEW error)
{
switch (error)
{
@@ -82,20 +82,20 @@ TCHAR* CToxProto::ToxErrorToString(TOX_ERR_NEW error) }
}
-TCHAR* CToxProto::ToxErrorToString(TOX_ERR_FRIEND_SEND_MESSAGE error)
+wchar_t* CToxProto::ToxErrorToString(TOX_ERR_FRIEND_SEND_MESSAGE error)
{
switch (error)
{
- case TOX_ERR_FRIEND_SEND_MESSAGE_NULL: - return TranslateT("One of the arguments is missing"); - case TOX_ERR_FRIEND_SEND_MESSAGE_FRIEND_NOT_FOUND: - return TranslateT("The friend number did not designate a valid friend"); - case TOX_ERR_FRIEND_SEND_MESSAGE_FRIEND_NOT_CONNECTED: - return TranslateT("This client is currently not connected to the friend"); - case TOX_ERR_FRIEND_SEND_MESSAGE_SENDQ: - return TranslateT("An allocation error occurred while increasing the send queue size"); - case TOX_ERR_FRIEND_SEND_MESSAGE_TOO_LONG: - return TranslateT("Message length exceeded TOX_MAX_MESSAGE_LENGTH"); + case TOX_ERR_FRIEND_SEND_MESSAGE_NULL:
+ return TranslateT("One of the arguments is missing");
+ case TOX_ERR_FRIEND_SEND_MESSAGE_FRIEND_NOT_FOUND:
+ return TranslateT("The friend number did not designate a valid friend");
+ case TOX_ERR_FRIEND_SEND_MESSAGE_FRIEND_NOT_CONNECTED:
+ return TranslateT("This client is currently not connected to the friend");
+ case TOX_ERR_FRIEND_SEND_MESSAGE_SENDQ:
+ return TranslateT("An allocation error occurred while increasing the send queue size");
+ case TOX_ERR_FRIEND_SEND_MESSAGE_TOO_LONG:
+ return TranslateT("Message length exceeded TOX_MAX_MESSAGE_LENGTH");
case TOX_ERR_FRIEND_SEND_MESSAGE_EMPTY:
return TranslateT("Attempted to send a zero-length message");
default:
@@ -103,7 +103,7 @@ TCHAR* CToxProto::ToxErrorToString(TOX_ERR_FRIEND_SEND_MESSAGE error) }
}
-void CToxProto::ShowNotification(const TCHAR *caption, const TCHAR *message, int flags, MCONTACT hContact)
+void CToxProto::ShowNotification(const wchar_t *caption, const wchar_t *message, int flags, MCONTACT hContact)
{
if (Miranda_Terminated())
{
@@ -125,14 +125,14 @@ void CToxProto::ShowNotification(const TCHAR *caption, const TCHAR *message, int MessageBox(NULL, message, caption, MB_OK | flags);
}
-void CToxProto::ShowNotification(const TCHAR *message, int flags, MCONTACT hContact)
+void CToxProto::ShowNotification(const wchar_t *message, int flags, MCONTACT hContact)
{
ShowNotification(_T(MODULE), message, flags, hContact);
}
-bool CToxProto::IsFileExists(const TCHAR* path)
+bool CToxProto::IsFileExists(const wchar_t* path)
{
- return _taccess(path, 0) == 0;
+ return _waccess(path, 0) == 0;
}
MEVENT CToxProto::AddEventToDb(MCONTACT hContact, WORD type, DWORD timestamp, DWORD flags, PBYTE pBlob, size_t cbBlob)
@@ -149,7 +149,7 @@ MEVENT CToxProto::AddEventToDb(MCONTACT hContact, WORD type, DWORD timestamp, DW INT_PTR CToxProto::ParseToxUri(WPARAM, LPARAM lParam)
{
- TCHAR *uri = (TCHAR*)lParam;
+ wchar_t *uri = (wchar_t*)lParam;
if (mir_tstrlen(uri) <= 4)
return 1;
@@ -168,7 +168,7 @@ INT_PTR CToxProto::ParseToxUri(WPARAM, LPARAM lParam) if (proto == NULL)
return 1;
- if (_tcschr(uri, _T('@')) != NULL)
+ if (wcschr(uri, '@') != NULL)
return 1;
PROTOSEARCHRESULT psr = { sizeof(psr) };
|