From 3dc0d9b0b7c30ea2f77d74c4ce5b6ccd67bd525c Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 9 Apr 2013 21:40:22 +0000 Subject: - the kernel filters out contacts by proto names much faster than a plugin; - database cycles simplified git-svn-id: http://svn.miranda-ng.org/main/trunk@4404 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/modules/clist/clistmod.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'src/modules/clist/clistmod.cpp') diff --git a/src/modules/clist/clistmod.cpp b/src/modules/clist/clistmod.cpp index 3b3797a90e..9ab769b65a 100644 --- a/src/modules/clist/clistmod.cpp +++ b/src/modules/clist/clistmod.cpp @@ -143,14 +143,10 @@ static int ProtocolAck(WPARAM, LPARAM lParam) if ((int)ack->hProcess < ID_STATUS_ONLINE && ack->lParam >= ID_STATUS_ONLINE) { DWORD caps = (DWORD)CallProtoServiceInt(NULL,ack->szModule, PS_GETCAPS, PFLAGNUM_1, 0); - if (caps & PF1_SERVERCLIST) { - for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { - char *szProto = GetContactProto(hContact); - if (szProto != NULL && !strcmp(szProto, ack->szModule)) - if (db_get_b(hContact, "CList", "Delete", 0)) - CallService(MS_DB_CONTACT_DELETE, (WPARAM) hContact, 0); - } - } + if (caps & PF1_SERVERCLIST) + for (HANDLE hContact = db_find_first(ack->szModule); hContact; hContact = db_find_next(hContact, ack->szModule)) + if (db_get_b(hContact, "CList", "Delete", 0)) + CallService(MS_DB_CONTACT_DELETE, (WPARAM)hContact, 0); } cli.pfnTrayIconUpdateBase(ack->szModule); -- cgit v1.2.3