summaryrefslogtreecommitdiff
path: root/plugins/KeyboardNotify/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2023-05-21 13:56:23 +0300
committerGeorge Hazan <george.hazan@gmail.com>2023-05-21 13:56:23 +0300
commitec8a7614a371f41937dc1dbc2d53289e45706e3a (patch)
treee5937361b3a7ce11eb9b1dbba9debc2d5c1b7339 /plugins/KeyboardNotify/src
parentd93053e9cca314179eea3fff202a32f8ec74b770 (diff)
static function pfnGetEvent removed from CLIST_INTERFACE
Diffstat (limited to 'plugins/KeyboardNotify/src')
-rw-r--r--plugins/KeyboardNotify/src/main.cpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/plugins/KeyboardNotify/src/main.cpp b/plugins/KeyboardNotify/src/main.cpp
index b0b65376aa..f4c1ac3e61 100644
--- a/plugins/KeyboardNotify/src/main.cpp
+++ b/plugins/KeyboardNotify/src/main.cpp
@@ -239,13 +239,11 @@ BOOL metaCheckProtocol(const char *szProto, MCONTACT hContact, uint16_t eventTyp
BOOL checkUnopenEvents()
{
- int nIndex;
- CLISTEVENT *pCLEvent;
-
if (nExternCount && bFlashOnOther)
return TRUE;
- for (nIndex = 0; pCLEvent = g_clistApi.pfnGetEvent(-1, nIndex); nIndex++) {
+ int nIndex = 0;
+ while (auto *pCLEvent = Clist_GetEvent(-1, nIndex)) {
DBEVENTINFO einfo = readEventInfo(pCLEvent->hDbEvent, pCLEvent->hContact);
if ((einfo.eventType == EVENTTYPE_MESSAGE && bFlashOnMsg) ||
@@ -254,6 +252,7 @@ BOOL checkUnopenEvents()
if (metaCheckProtocol(einfo.szModule, pCLEvent->hContact, einfo.eventType))
return TRUE;
+ nIndex++;
}
return FALSE;
@@ -426,26 +425,27 @@ static int OnGcEvent(WPARAM, LPARAM lParam)
static VOID CALLBACK ReminderTimer(HWND, UINT, UINT_PTR, DWORD)
{
- int nIndex;
- CLISTEVENT *pCLEvent;
-
if (!bReminderDisabled && nExternCount && bFlashOnOther) {
SetEvent(hFlashEvent);
return;
}
- for (nIndex = 0; !bReminderDisabled && (pCLEvent = g_clistApi.pfnGetEvent(-1, nIndex)); nIndex++) {
- DBEVENTINFO einfo = readEventInfo(pCLEvent->hDbEvent, pCLEvent->hContact);
+ int nIndex = 0;
+ while (auto *pCLEvent = Clist_GetEvent(-1, nIndex)) {
+ if (bReminderDisabled)
+ break;
+ DBEVENTINFO einfo = readEventInfo(pCLEvent->hDbEvent, pCLEvent->hContact);
if ((einfo.eventType == EVENTTYPE_MESSAGE && bFlashOnMsg) ||
- (einfo.eventType == EVENTTYPE_FILE && bFlashOnFile) ||
- (einfo.eventType != EVENTTYPE_MESSAGE && einfo.eventType != EVENTTYPE_FILE && bFlashOnOther))
+ (einfo.eventType == EVENTTYPE_FILE && bFlashOnFile) ||
+ (einfo.eventType != EVENTTYPE_MESSAGE && einfo.eventType != EVENTTYPE_FILE && bFlashOnOther))
if (metaCheckProtocol(einfo.szModule, pCLEvent->hContact, einfo.eventType) && checkNotifyOptions() && checkStatus(einfo.szModule) && checkXstatus(einfo.szModule)) {
-
SetEvent(hFlashEvent);
return;
}
+
+ nIndex++;
}
}
@@ -847,10 +847,8 @@ BOOL CheckMsgWnd(MCONTACT hContact, BOOL *focus)
void countUnopenEvents(int *msgCount, int *fileCount, int *otherCount)
{
- int nIndex;
- CLISTEVENT *pCLEvent;
-
- for (nIndex = 0; pCLEvent = g_clistApi.pfnGetEvent(-1, nIndex); nIndex++) {
+ int nIndex = 0;
+ while (auto *pCLEvent = Clist_GetEvent(-1, nIndex)) {
DBEVENTINFO einfo = readEventInfo(pCLEvent->hDbEvent, pCLEvent->hContact);
if (metaCheckProtocol(einfo.szModule, pCLEvent->hContact, einfo.eventType)) {
@@ -868,7 +866,9 @@ void countUnopenEvents(int *msgCount, int *fileCount, int *otherCount)
(*otherCount)++;
}
}
+ nIndex++;
}
+
if (bFlashOnOther)
(*otherCount) += nExternCount;
}