From 109877a3c75cb290c55755dcfc88794d2453669d Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 30 Mar 2013 17:32:39 +0000 Subject: MS_DB_EVENT_* services remained, but their calls removed git-svn-id: http://svn.miranda-ng.org/main/trunk@4255 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/KeyboardNotify/src/main.cpp | 29 +++++++---------------------- 1 file changed, 7 insertions(+), 22 deletions(-) (limited to 'plugins/KeyboardNotify') diff --git a/plugins/KeyboardNotify/src/main.cpp b/plugins/KeyboardNotify/src/main.cpp index b3bdaea314..31b3f94623 100644 --- a/plugins/KeyboardNotify/src/main.cpp +++ b/plugins/KeyboardNotify/src/main.cpp @@ -326,16 +326,11 @@ DBEVENTINFO createMsgEventInfo(HANDLE hContact) DBEVENTINFO readEventInfo(HANDLE hDbEvent, HANDLE hContact) { - DBEVENTINFO einfo = {0}; - if (hDbEvent == NCONVERS_BLINKID) // we need to handle nconvers' blink event return createMsgEventInfo(hContact); - einfo.cbSize = sizeof(einfo); - einfo.cbBlob = 0; - einfo.pBlob = NULL; - CallService(MS_DB_EVENT_GET, (WPARAM)hDbEvent, (LPARAM)&einfo); - + DBEVENTINFO einfo = { sizeof(einfo) }; + db_event_get(hDbEvent, &einfo); return einfo; } @@ -468,18 +463,12 @@ static void FlashThreadFunction() BOOL checkMsgTimestamp(HANDLE hEventCurrent, DWORD timestampCurrent) { - HANDLE hEvent; - if (!bFlashIfMsgOlder) return TRUE; - for (hEvent=(HANDLE)CallService(MS_DB_EVENT_FINDPREV, (WPARAM)hEventCurrent, 0); hEvent; hEvent=(HANDLE)CallService(MS_DB_EVENT_FINDPREV, (WPARAM)hEvent, 0)) { - DBEVENTINFO einfo = {0}; - - einfo.cbSize = sizeof(einfo); - einfo.cbBlob = 0; - einfo.pBlob = NULL; - CallService(MS_DB_EVENT_GET, (WPARAM)hEvent, (LPARAM)&einfo); + for (HANDLE hEvent = db_event_prev(hEventCurrent); hEvent; hEvent = db_event_prev(hEvent)) { + DBEVENTINFO einfo = { sizeof(einfo) }; + db_event_get(hEvent, &einfo); if ((einfo.timestamp + wSecondsOlder) <= timestampCurrent) return TRUE; if (einfo.eventType == EVENTTYPE_MESSAGE) @@ -539,16 +528,12 @@ BOOL checkXstatus(char *szProto) // 'Pings' the FlashThread to keep the LEDs flashing. static int PluginMessageEventHook(WPARAM wParam, LPARAM lParam) { - DBEVENTINFO einfo = {0}; HANDLE hContact = (HANDLE)wParam; HANDLE hEvent = (HANDLE)lParam; //get DBEVENTINFO without pBlob - einfo.cbSize = sizeof(einfo); - einfo.cbBlob = 0; - einfo.pBlob = NULL; - CallService(MS_DB_EVENT_GET, (WPARAM)hEvent, (LPARAM)&einfo); - + DBEVENTINFO einfo = { sizeof(einfo) }; + db_event_get(hEvent, &einfo); if (!(einfo.flags & DBEF_SENT)) if ((einfo.eventType == EVENTTYPE_MESSAGE && bFlashOnMsg && checkOpenWindow(hContact) && checkMsgTimestamp(hEvent, einfo.timestamp)) || (einfo.eventType == EVENTTYPE_URL && bFlashOnURL) || -- cgit v1.2.3