From 78f97fe198286a120370f6c56921205191f986b0 Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Fri, 10 Apr 2015 12:01:55 +0000 Subject: Tox: - switched to new api - updated tox core git-svn-id: http://svn.miranda-ng.org/main/trunk@12726 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Tox/src/tox_utils.cpp | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) (limited to 'protocols/Tox/src/tox_utils.cpp') diff --git a/protocols/Tox/src/tox_utils.cpp b/protocols/Tox/src/tox_utils.cpp index ccbb41effd..29e43d425b 100644 --- a/protocols/Tox/src/tox_utils.cpp +++ b/protocols/Tox/src/tox_utils.cpp @@ -1,32 +1,32 @@ #include "common.h" -TOX_USERSTATUS CToxProto::MirandaToToxStatus(int status) +TOX_USER_STATUS CToxProto::MirandaToToxStatus(int status) { - TOX_USERSTATUS userstatus = TOX_USERSTATUS_NONE; + TOX_USER_STATUS userstatus = TOX_USER_STATUS_NONE; switch (status) { case ID_STATUS_AWAY: - userstatus = TOX_USERSTATUS_AWAY; + userstatus = TOX_USER_STATUS_AWAY; break; case ID_STATUS_OCCUPIED: - userstatus = TOX_USERSTATUS_BUSY; + userstatus = TOX_USER_STATUS_BUSY; break; } return userstatus; } -int CToxProto::ToxToMirandaStatus(TOX_USERSTATUS userstatus) +int CToxProto::ToxToMirandaStatus(TOX_USER_STATUS userstatus) { int status = ID_STATUS_OFFLINE; switch (userstatus) { - case TOX_USERSTATUS_NONE: + case TOX_USER_STATUS_NONE: status = ID_STATUS_ONLINE; break; - case TOX_USERSTATUS_AWAY: + case TOX_USER_STATUS_AWAY: status = ID_STATUS_AWAY; break; - case TOX_USERSTATUS_BUSY: + case TOX_USER_STATUS_BUSY: status = ID_STATUS_OCCUPIED; break; } @@ -62,13 +62,5 @@ void CToxProto::ShowNotification(const TCHAR *message, int flags, MCONTACT hCont bool CToxProto::IsFileExists(std::tstring path) { - //return ::GetFileAttributes(fileName) != DWORD(-1) - WIN32_FIND_DATA wfd; - HANDLE hFind = FindFirstFile(path.c_str(), &wfd); - if (INVALID_HANDLE_VALUE != hFind) - { - FindClose(hFind); - return true; - } - return false; + return _taccess(path.c_str(), 0) == 0; } \ No newline at end of file -- cgit v1.2.3