summaryrefslogtreecommitdiff
path: root/plugins/NewXstatusNotify/src/main.cpp
diff options
context:
space:
mode:
authorSergey Tatarinov <tatarinov.sergey@gmail.com>2013-11-02 10:15:03 +0000
committerSergey Tatarinov <tatarinov.sergey@gmail.com>2013-11-02 10:15:03 +0000
commit872957d378790f44ec8749bd05067695bb45d8ea (patch)
treeab9a4708db79cb30b383262e11ebfb4bbafbf9f1 /plugins/NewXstatusNotify/src/main.cpp
parentd993bef95dc1703515d01ca69e51fb48e6c0fbe5 (diff)
NewXstatusNotify: restored last seen implementation, now it's hidden option, disabled by default, no one hurt, not slow down the work.
git-svn-id: http://svn.miranda-ng.org/main/trunk@6739 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/NewXstatusNotify/src/main.cpp')
-rw-r--r--plugins/NewXstatusNotify/src/main.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/plugins/NewXstatusNotify/src/main.cpp b/plugins/NewXstatusNotify/src/main.cpp
index 91689bf1c8..3c01e6802a 100644
--- a/plugins/NewXstatusNotify/src/main.cpp
+++ b/plugins/NewXstatusNotify/src/main.cpp
@@ -762,6 +762,20 @@ int ContactStatusChanged(WPARAM wParam, LPARAM lParam)
strcpy(szProto, hlpProto);
WORD myStatus = (WORD)CallProtoService(szProto, PS_GETSTATUS, 0, 0);
+ if (opt.EnableLastSeen && newStatus == ID_STATUS_OFFLINE && oldStatus > ID_STATUS_OFFLINE) {
+ // A simple implementation of Last Seen module, please don't touch this.
+ SYSTEMTIME systime;
+ GetLocalTime(&systime);
+
+ db_set_w(hContact, "SeenModule", "Year", systime.wYear);
+ db_set_w(hContact, "SeenModule", "Month", systime.wMonth);
+ db_set_w(hContact, "SeenModule", "Day", systime.wDay);
+ db_set_w(hContact, "SeenModule", "Hours", systime.wHour);
+ db_set_w(hContact, "SeenModule", "Minutes", systime.wMinute);
+ db_set_w(hContact, "SeenModule", "Seconds", systime.wSecond);
+ db_set_w(hContact, "SeenModule", "Status", oldStatus);
+ }
+
if (strcmp(szProto, szMetaModuleName) == 0) { //this contact is Meta
HANDLE hSubContact = (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0);
hlpProto = GetContactProto(hSubContact);