From 5a09915186e4ae70cc39e9343ca02a1b860d7f94 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 14 May 2020 12:34:32 +0300 Subject: simple database event cycles moved to cursors --- plugins/StopSpamPlus/src/utils.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'plugins/StopSpamPlus') diff --git a/plugins/StopSpamPlus/src/utils.cpp b/plugins/StopSpamPlus/src/utils.cpp index e01f73802e..427495026c 100644 --- a/plugins/StopSpamPlus/src/utils.cpp +++ b/plugins/StopSpamPlus/src/utils.cpp @@ -14,8 +14,8 @@ tstring& GetDlgItemString(HWND hwnd, int id) bool IsExistMyMessage(MCONTACT hContact) { - MEVENT hDbEvent = db_event_first(hContact); - while (hDbEvent) { + DB::ECPTR pCursor(DB::Events(hContact)); + while (MEVENT hDbEvent = pCursor.FetchNext()) { DBEVENTINFO dbei = {}; if (db_event_get(hDbEvent, &dbei)) break; @@ -26,7 +26,6 @@ bool IsExistMyMessage(MCONTACT hContact) // ...let the event go its way return true; } - hDbEvent = db_event_next(hContact, hDbEvent); } return false; } -- cgit v1.2.3