summaryrefslogtreecommitdiff
path: root/protocols/Tox/src/tox_utils.cpp
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2014-08-12 18:28:50 +0000
committerAlexander Lantsev <aunsane@gmail.com>2014-08-12 18:28:50 +0000
commit4330c62d2fa5b2752036b43018044c7c01b10695 (patch)
tree41001600877a55ad94ab03f9ccbbe3fab56585ad /protocols/Tox/src/tox_utils.cpp
parentc1fdf24779e15d5a1063340b35a4f7b2e3bf9d6a (diff)
Tox: contact name, status, status message saving
git-svn-id: http://svn.miranda-ng.org/main/trunk@10167 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Tox/src/tox_utils.cpp')
-rw-r--r--protocols/Tox/src/tox_utils.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/protocols/Tox/src/tox_utils.cpp b/protocols/Tox/src/tox_utils.cpp
index bd26d9136b..4876b7e9fd 100644
--- a/protocols/Tox/src/tox_utils.cpp
+++ b/protocols/Tox/src/tox_utils.cpp
@@ -21,6 +21,27 @@ TOX_USERSTATUS CToxProto::MirandaToToxStatus(int status)
return userstatus;
}
+int CToxProto::ToxToMirandaStatus(TOX_USERSTATUS userstatus)
+{
+ int status;
+ switch (userstatus)
+ {
+ case TOX_USERSTATUS_NONE:
+ status = ID_STATUS_ONLINE;
+ break;
+ case TOX_USERSTATUS_AWAY:
+ status = ID_STATUS_AWAY;
+ break;
+ case TOX_USERSTATUS_BUSY:
+ status = ID_STATUS_OCCUPIED;
+ break;
+ default:
+ status = ID_STATUS_OFFLINE;
+ break;
+ }
+ return status;
+}
+
HANDLE CToxProto::AddDbEvent(MCONTACT hContact, WORD type, DWORD timestamp, DWORD flags, DWORD cbBlob, PBYTE pBlob)
{
DBEVENTINFO dbei = { sizeof(dbei) };