summaryrefslogtreecommitdiff
path: root/protocols/GTalkExt
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-12-24 18:30:10 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-12-24 18:30:10 +0000
commit38c623b058e34a49e6cd8e4a2a552c22075d980b (patch)
treed68c24e4bc14664d1a21f408fc0515297aa709d9 /protocols/GTalkExt
parentb2ab6c5a7f3a94144d70daa53f3fb74b0cec7491 (diff)
more effective event remover
git-svn-id: http://svn.miranda-ng.org/main/trunk@7372 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/GTalkExt')
-rw-r--r--protocols/GTalkExt/src/notifications.cpp12
1 files changed, 8 insertions, 4 deletions
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)