summaryrefslogtreecommitdiff
path: root/protocols/Tox/src/tox_utils.cpp
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2015-09-10 13:39:26 +0000
committerAlexander Lantsev <aunsane@gmail.com>2015-09-10 13:39:26 +0000
commit9cbcc4a1234b3ad61110eb733ed8b154f8e3ff68 (patch)
tree2b98954bcd12c6bc3b0decebdd929bd5fe9e80fd /protocols/Tox/src/tox_utils.cpp
parent510f938a5c6f0ee95ac0b36e56aced065228298e (diff)
Tox: refactoring
git-svn-id: http://svn.miranda-ng.org/main/trunk@15317 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Tox/src/tox_utils.cpp')
-rw-r--r--protocols/Tox/src/tox_utils.cpp26
1 files changed, 24 insertions, 2 deletions
diff --git a/protocols/Tox/src/tox_utils.cpp b/protocols/Tox/src/tox_utils.cpp
index e0a3e9f514..da18be8bdb 100644
--- a/protocols/Tox/src/tox_utils.cpp
+++ b/protocols/Tox/src/tox_utils.cpp
@@ -1,5 +1,27 @@
#include "stdafx.h"
+int CToxProto::MapStatus(int status)
+{
+ switch (status)
+ {
+ case ID_STATUS_FREECHAT:
+ case ID_STATUS_ONTHEPHONE:
+ status = ID_STATUS_ONLINE;
+ break;
+
+ case ID_STATUS_NA:
+ case ID_STATUS_OUTTOLUNCH:
+ status = ID_STATUS_AWAY;
+ break;
+
+ case ID_STATUS_DND:
+ case ID_STATUS_INVISIBLE:
+ status = ID_STATUS_OCCUPIED;
+ break;
+ }
+ return status;
+}
+
TOX_USER_STATUS CToxProto::MirandaToToxStatus(int status)
{
TOX_USER_STATUS userstatus = TOX_USER_STATUS_NONE;
@@ -87,9 +109,9 @@ void CToxProto::ShowNotification(const TCHAR *message, int flags, MCONTACT hCont
ShowNotification(_T(MODULE), message, flags, hContact);
}
-bool CToxProto::IsFileExists(std::tstring path)
+bool CToxProto::IsFileExists(const TCHAR* path)
{
- return _taccess(path.c_str(), 0) == 0;
+ return _taccess(path, 0) == 0;
}
MEVENT CToxProto::AddEventToDb(MCONTACT hContact, WORD type, DWORD timestamp, DWORD flags, PBYTE pBlob, size_t cbBlob)