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 --- plugins/MetaContacts/src/meta_main.cpp | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'plugins/MetaContacts/src') diff --git a/plugins/MetaContacts/src/meta_main.cpp b/plugins/MetaContacts/src/meta_main.cpp index 3361bdc475..023bca8a82 100644 --- a/plugins/MetaContacts/src/meta_main.cpp +++ b/plugins/MetaContacts/src/meta_main.cpp @@ -151,18 +151,15 @@ extern "C" __declspec(dllexport) int Load(void) CallService(MS_DB_SETSETTINGRESIDENT, TRUE, (LPARAM)(META_PROTO "/WindowOpen")); //set all contacts to 'offline', and initialize subcontact counter for db consistency check - for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { - char *proto = GetContactProto(hContact); - if (proto && !lstrcmpA( META_PROTO, proto)) { - db_set_w(hContact, META_PROTO, "Status", ID_STATUS_OFFLINE); - db_set_dw(hContact, META_PROTO, "IdleTS", 0); - db_set_b(hContact, META_PROTO, "ContactCountCheck", 0); - - // restore any saved defaults that might have remained if miranda was closed or crashed while a convo was happening - if (db_get_dw(hContact, META_PROTO, "SavedDefault", (DWORD)-1) != (DWORD)-1) { - db_set_dw(hContact, META_PROTO, "Default", db_get_dw(hContact, META_PROTO, "SavedDefault", 0)); - db_set_dw(hContact, META_PROTO, "SavedDefault", (DWORD)-1); - } + for (HANDLE hContact = db_find_first(META_PROTO); hContact; hContact = db_find_next(hContact, META_PROTO)) { + db_set_w(hContact, META_PROTO, "Status", ID_STATUS_OFFLINE); + db_set_dw(hContact, META_PROTO, "IdleTS", 0); + db_set_b(hContact, META_PROTO, "ContactCountCheck", 0); + + // restore any saved defaults that might have remained if miranda was closed or crashed while a convo was happening + if (db_get_dw(hContact, META_PROTO, "SavedDefault", (DWORD)-1) != (DWORD)-1) { + db_set_dw(hContact, META_PROTO, "Default", db_get_dw(hContact, META_PROTO, "SavedDefault", 0)); + db_set_dw(hContact, META_PROTO, "SavedDefault", (DWORD)-1); } } -- cgit v1.2.3