From 38c623b058e34a49e6cd8e4a2a552c22075d980b Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 24 Dec 2013 18:30:10 +0000 Subject: more effective event remover git-svn-id: http://svn.miranda-ng.org/main/trunk@7372 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/GTalkExt/src/notifications.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'protocols/GTalkExt/src') diff --git a/protocols/GTalkExt/src/notifications.cpp b/protocols/GTalkExt/src/notifications.cpp index 86259b5632..30321de558 100644 --- a/protocols/GTalkExt/src/notifications.cpp +++ b/protocols/GTalkExt/src/notifications.cpp @@ -287,11 +287,15 @@ void UnreadThreadNotification(LPCSTR acc, LPCTSTR jid, LPCTSTR url, LPCTSTR unre void ClearNotificationContactHistory(LPCSTR acc) { - HANDLE hEvent = 0; HANDLE hContact = (HANDLE)db_get_dw(NULL, acc, PSEUDOCONTACT_LINK, 0); - if (hContact && db_get_b(hContact, SHORT_PLUGIN_NAME, PSEUDOCONTACT_FLAG, 0)) - while ((hEvent = db_event_last(hContact)) && !db_event_delete(hContact, hEvent)) - ; + if (!hContact || !db_get_b(hContact, SHORT_PLUGIN_NAME, PSEUDOCONTACT_FLAG, 0)) + return; + + for (HANDLE hEvent = db_event_first(hContact); hEvent;) { + HANDLE hEvent1 = db_event_next(hEvent); + db_event_delete(hContact, hEvent); + hEvent = hEvent1; + } } DWORD ReadNotificationSettings(LPCSTR acc) -- cgit v1.2.3