diff options
author | George Hazan <george.hazan@gmail.com> | 2014-03-31 18:52:40 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-03-31 18:52:40 +0000 |
commit | 72b7008d4d971d220035532350c49cd8297f5b9b (patch) | |
tree | 87340ede2258b589ee6c600f6693279b60ffdbd1 | |
parent | 1e31191afc0fbaeb211bc1f2c250ee155d21d0c0 (diff) |
new kosher version of the contacts' deleter (when account is being deleted)
git-svn-id: http://svn.miranda-ng.org/main/trunk@8808 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r-- | src/modules/protocols/protoaccs.cpp | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/src/modules/protocols/protoaccs.cpp b/src/modules/protocols/protoaccs.cpp index 9fd416ad78..e5142abb10 100644 --- a/src/modules/protocols/protoaccs.cpp +++ b/src/modules/protocols/protoaccs.cpp @@ -260,11 +260,9 @@ static int UninitializeStaticAccounts(WPARAM, LPARAM) int LoadAccountsModule(void)
{
- int i;
-
bModuleInitialized = TRUE;
- for (i=0; i < accounts.getCount(); i++) {
+ for (int i=0; i < accounts.getCount(); i++) {
PROTOACCOUNT *pa = accounts[i];
pa->bDynDisabled = !Proto_IsProtocolLoaded(pa->szProtoName);
if (pa->ppro)
@@ -544,14 +542,10 @@ void DeactivateAccount(PROTOACCOUNT *pa, bool bIsDynamic, bool bErase) void EraseAccount(const char* pszModuleName)
{
// remove protocol contacts first
- MCONTACT hContact = db_find_first();
- while (hContact != NULL) {
- MCONTACT h1 = hContact;
- hContact = db_find_next(h1);
-
- char *szProto = GetContactProto(hContact);
- if (szProto != NULL && !lstrcmpA(szProto, pszModuleName))
- CallService(MS_DB_CONTACT_DELETE, (WPARAM)h1, 0);
+ for (MCONTACT hContact = db_find_first(pszModuleName); hContact != NULL;) {
+ MCONTACT hNext = db_find_next(hContact, pszModuleName);
+ CallService(MS_DB_CONTACT_DELETE, hContact, 0);
+ hContact = hNext;
}
// remove all protocol settings
|