From c9265783b1bf4a9cea1fd63e633ced6e66a154fc Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 10 Dec 2017 15:24:14 +0300 Subject: Miranda idle code cleaning --- plugins/SimpleStatusMsg/src/main.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'plugins/SimpleStatusMsg/src') diff --git a/plugins/SimpleStatusMsg/src/main.cpp b/plugins/SimpleStatusMsg/src/main.cpp index fae0b03fcd..ea0e1a8725 100644 --- a/plugins/SimpleStatusMsg/src/main.cpp +++ b/plugins/SimpleStatusMsg/src/main.cpp @@ -204,9 +204,8 @@ wchar_t* InsertBuiltinVarsIntoMsg(wchar_t *in, const char *szProto, int) } else if (!wcsnicmp(msg + i, L"%time%", 6)) { - MIRANDA_IDLE_INFO mii = {0}; - mii.cbSize = sizeof(mii); - CallService(MS_IDLE_GETIDLEINFO, 0, (LPARAM)&mii); + MIRANDA_IDLE_INFO mii; + Idle_GetInfo(mii); if (mii.idleType) { @@ -1268,9 +1267,8 @@ VOID CALLBACK SetStartupStatusProc(HWND hwnd, UINT, UINT_PTR idEvent, DWORD) VOID CALLBACK UpdateMsgTimerProc(HWND, UINT, UINT_PTR, DWORD) { - MIRANDA_IDLE_INFO mii = {0}; - mii.cbSize = sizeof(mii); - CallService(MS_IDLE_GETIDLEINFO, 0, (LPARAM)&mii); + MIRANDA_IDLE_INFO mii; + Idle_GetInfo(mii); if (db_get_b(NULL, "SimpleStatusMsg", "NoUpdateOnIdle", 1) && mii.idleType) return; @@ -1436,9 +1434,9 @@ static int OnIdleChanged(WPARAM, LPARAM lParam) if (!(lParam & IDF_ISIDLE)) g_iIdleTime = -1; - MIRANDA_IDLE_INFO mii = {0}; - mii.cbSize = sizeof(mii); - CallService(MS_IDLE_GETIDLEINFO, 0, (LPARAM)&mii); + MIRANDA_IDLE_INFO mii; + Idle_GetInfo(mii); + if (mii.aaStatus == 0) { #ifdef _DEBUG -- cgit v1.2.3