From f5c0b6951727dacee2fce60421cb23f7dd5e3adc Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 29 Dec 2018 21:00:37 +0300 Subject: code cleaning --- plugins/SeenPlugin/src/utils.cpp | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) (limited to 'plugins/SeenPlugin') diff --git a/plugins/SeenPlugin/src/utils.cpp b/plugins/SeenPlugin/src/utils.cpp index 7958603b6a..5903d50db5 100644 --- a/plugins/SeenPlugin/src/utils.cpp +++ b/plugins/SeenPlugin/src/utils.cpp @@ -380,28 +380,26 @@ wchar_t* ParseString(wchar_t *szstring, MCONTACT hcontact) return sztemp; } -void _DBWriteTime(SYSTEMTIME *st, MCONTACT hcontact) -{ - g_plugin.setWord(hcontact, "Day", st->wDay); - g_plugin.setWord(hcontact, "Month", st->wMonth); - g_plugin.setWord(hcontact, "Year", st->wYear); - g_plugin.setWord(hcontact, "Hours", st->wHour); - g_plugin.setWord(hcontact, "Minutes", st->wMinute); - g_plugin.setWord(hcontact, "Seconds", st->wSecond); - g_plugin.setWord(hcontact, "WeekDay", st->wDayOfWeek); -} - void DBWriteTimeTS(DWORD t, MCONTACT hcontact) { - SYSTEMTIME st; - FILETIME ft; ULONGLONG ll = UInt32x32To64(TimeZone_ToLocal(t), 10000000) + NUM100NANOSEC; + + FILETIME ft; ft.dwLowDateTime = (DWORD)ll; ft.dwHighDateTime = (DWORD)(ll >> 32); + + SYSTEMTIME st; FileTimeToSystemTime(&ft, &st); g_plugin.setDword(hcontact, "seenTS", t); - _DBWriteTime(&st, hcontact); + g_plugin.setWord(hcontact, "Day", st.wDay); + g_plugin.setWord(hcontact, "Month", st.wMonth); + g_plugin.setWord(hcontact, "Year", st.wYear); + g_plugin.setWord(hcontact, "Hours", st.wHour); + g_plugin.setWord(hcontact, "Minutes", st.wMinute); + g_plugin.setWord(hcontact, "Seconds", st.wSecond); + g_plugin.setWord(hcontact, "WeekDay", st.wDayOfWeek); } + void GetColorsFromDWord(LPCOLORREF First, LPCOLORREF Second, DWORD colDword) { WORD temp; @@ -571,6 +569,7 @@ int UpdateValues(WPARAM hContact, LPARAM lparam) else prevStatus |= 0x8000; } + if ((cws->value.wVal | 0x8000) <= ID_STATUS_OFFLINE) { // avoid repeating the offline status if ((prevStatus | 0x8000) <= ID_STATUS_OFFLINE) -- cgit v1.2.3