summaryrefslogtreecommitdiff
path: root/plugins/NewXstatusNotify/src
diff options
context:
space:
mode:
authorSergey Tatarinov <tatarinov.sergey@gmail.com>2013-05-25 19:26:08 +0000
committerSergey Tatarinov <tatarinov.sergey@gmail.com>2013-05-25 19:26:08 +0000
commit20c3e88cab43b37798d2ef74f10413745f1d2018 (patch)
tree0887efbe3e48f5fb429c8f816c2e5a9c0d13ff57 /plugins/NewXstatusNotify/src
parente6efff93cd164a51796e485589dd677d2b204345 (diff)
NewXstatusNotify: added ability to save information when a contact was last seen online, if the SeenPlugin is not installed. The information is stored in a SeenPlugin's format and it can be shown in the Tipper's tooltip.
git-svn-id: http://svn.miranda-ng.org/main/trunk@4822 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/NewXstatusNotify/src')
-rw-r--r--plugins/NewXstatusNotify/src/main.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/plugins/NewXstatusNotify/src/main.cpp b/plugins/NewXstatusNotify/src/main.cpp
index e4b78fa474..9398b08429 100644
--- a/plugins/NewXstatusNotify/src/main.cpp
+++ b/plugins/NewXstatusNotify/src/main.cpp
@@ -766,6 +766,19 @@ int ContactStatusChanged(WPARAM wParam, LPARAM lParam)
strcpy(szProto, hlpProto);
WORD myStatus = (WORD)CallProtoService(szProto, PS_GETSTATUS, 0, 0);
+ if ( !ServiceExists("LastSeenUserDetails") && newStatus == ID_STATUS_OFFLINE && oldStatus > ID_STATUS_OFFLINE ) { // if SeenPlugin not installed write Last Seen info
+ 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);