From bf37d6655a27cc3ea5af5412c9717596c9d1c30f Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 19 Jun 2015 18:18:13 +0000 Subject: timezone api migrated to mir_core git-svn-id: http://svn.miranda-ng.org/main/trunk@14266 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/SeenPlugin/src/seen.h | 1 + plugins/SeenPlugin/src/utils.cpp | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'plugins/SeenPlugin/src') diff --git a/plugins/SeenPlugin/src/seen.h b/plugins/SeenPlugin/src/seen.h index 6f2273546b..4a83833fe6 100644 --- a/plugins/SeenPlugin/src/seen.h +++ b/plugins/SeenPlugin/src/seen.h @@ -41,6 +41,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #include #include +#include #include #include #include diff --git a/plugins/SeenPlugin/src/utils.cpp b/plugins/SeenPlugin/src/utils.cpp index ea0df3cb61..6a1818d295 100644 --- a/plugins/SeenPlugin/src/utils.cpp +++ b/plugins/SeenPlugin/src/utils.cpp @@ -105,7 +105,7 @@ DWORD isSeen(MCONTACT hcontact, SYSTEMTIME *st) DWORD res = db_get_dw(hcontact, S_MOD, "seenTS", 0); if (res) { if (st) { - ll = UInt32x32To64(CallService(MS_DB_TIME_TIMESTAMPTOLOCAL, res, 0), 10000000) + NUM100NANOSEC; + ll = UInt32x32To64(TimeZone_ToLocal(res), 10000000) + NUM100NANOSEC; ft.dwLowDateTime = (DWORD)ll; ft.dwHighDateTime = (DWORD)(ll >> 32); FileTimeToSystemTime(&ft, st); @@ -127,7 +127,7 @@ DWORD isSeen(MCONTACT hcontact, SYSTEMTIME *st) ll -= NUM100NANOSEC; ll /= 10000000; //perform LOCALTOTIMESTAMP - res = (DWORD)ll - CallService(MS_DB_TIME_TIMESTAMPTOLOCAL, 0, 0); + res = (DWORD)ll - TimeZone_ToLocal(0); //nevel look for Year/Month/Day/Hour/Minute/Second again db_set_dw(hcontact, S_MOD, "seenTS", res); } @@ -406,7 +406,7 @@ void DBWriteTimeTS(DWORD t, MCONTACT hcontact) { SYSTEMTIME st; FILETIME ft; - ULONGLONG ll = UInt32x32To64(CallService(MS_DB_TIME_TIMESTAMPTOLOCAL, t, 0), 10000000) + NUM100NANOSEC; + ULONGLONG ll = UInt32x32To64(TimeZone_ToLocal(t), 10000000) + NUM100NANOSEC; ft.dwLowDateTime = (DWORD)ll; ft.dwHighDateTime = (DWORD)(ll >> 32); FileTimeToSystemTime(&ft, &st); -- cgit v1.2.3