From c6fb861d7159279b6ee4a4dd678d4693ee56bac6 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 7 Oct 2012 12:50:40 +0000 Subject: death of old nasty clutch with MS_PROTO_ENUMPROTOCOLS & PROTOACCOUNT::type git-svn-id: http://svn.miranda-ng.org/main/trunk@1799 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/modules/protocols/protoaccs.cpp | 12 ++++-------- src/modules/protocols/protocols.cpp | 1 - src/modules/protocols/protoopts.cpp | 6 +++--- 3 files changed, 7 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/modules/protocols/protoaccs.cpp b/src/modules/protocols/protoaccs.cpp index c21e1a85c8..eef0ef61a4 100644 --- a/src/modules/protocols/protoaccs.cpp +++ b/src/modules/protocols/protoaccs.cpp @@ -46,7 +46,6 @@ static int EnumDbModules(const char *szModuleName, DWORD ofsModuleName, LPARAM l if ( !Proto_GetAccount(szModuleName)) { PROTOACCOUNT* pa = (PROTOACCOUNT*)mir_calloc(sizeof(PROTOACCOUNT)); pa->cbSize = sizeof(*pa); - pa->type = PROTOTYPE_PROTOCOL; pa->szModuleName = mir_strdup(szModuleName); pa->szProtoName = mir_strdup(dbv.pszVal); pa->tszAccountName = mir_a2t(szModuleName); @@ -78,7 +77,6 @@ void LoadDbAccounts(void) continue; } pa->cbSize = sizeof(*pa); - pa->type = PROTOTYPE_PROTOCOL; pa->szModuleName = mir_strdup(dbv.pszVal); DBFreeVariant(&dbv); @@ -271,14 +269,13 @@ int LoadAccountsModule(void) continue; if ( !Proto_IsAccountEnabled(pa)) { - pa->type = PROTOTYPE_DISPROTO; + pa->bDynDisabled = TRUE; continue; } - if ( !ActivateAccount(pa)) { + if ( !ActivateAccount(pa)) pa->bDynDisabled = TRUE; - pa->type = PROTOTYPE_DISPROTO; - } } + } HookEvent(ME_SYSTEM_MODULESLOADED, InitializeStaticAccounts); HookEvent(ME_SYSTEM_PRESHUTDOWN, UninitializeStaticAccounts); @@ -430,7 +427,6 @@ BOOL ActivateAccount(PROTOACCOUNT* pa) if (ppi == NULL) return FALSE; - pa->type = PROTOTYPE_PROTOCOL; pa->ppro = ppi; ppi->m_iDesiredStatus = ppi->m_iStatus = ID_STATUS_OFFLINE; CreateProtoServiceEx(pa->szModuleName, PS_ADDTOLIST, (MIRANDASERVICEOBJ)stub1, pa->ppro); @@ -539,7 +535,7 @@ void DeactivateAccount(PROTOACCOUNT* pa, bool bIsDynamic, bool bErase) param->bIsDynamic = bIsDynamic; param->bErase = bErase; pa->ppro = NULL; - pa->type = PROTOTYPE_DISPROTO; + pa->bDynDisabled = TRUE; if (bIsDynamic) mir_forkthread((pThreadFunc)DeactivationThread, param); else diff --git a/src/modules/protocols/protocols.cpp b/src/modules/protocols/protocols.cpp index f2bada7aa0..4ecb0cb056 100644 --- a/src/modules/protocols/protocols.cpp +++ b/src/modules/protocols/protocols.cpp @@ -130,7 +130,6 @@ static INT_PTR Proto_RegisterModule(WPARAM, LPARAM lParam) if (pa == NULL) { pa = (PROTOACCOUNT*)mir_calloc(sizeof(PROTOACCOUNT)); pa->cbSize = sizeof(PROTOACCOUNT); - pa->type = PROTOTYPE_PROTOCOL; pa->szModuleName = mir_strdup(pd->szName); pa->szProtoName = mir_strdup(pd->szName); pa->tszAccountName = mir_a2t(pd->szName); diff --git a/src/modules/protocols/protoopts.cpp b/src/modules/protocols/protoopts.cpp index c6c43f4169..d5734105f0 100644 --- a/src/modules/protocols/protoopts.cpp +++ b/src/modules/protocols/protoopts.cpp @@ -155,7 +155,6 @@ static INT_PTR CALLBACK AccFormDlgProc(HWND hwndDlg, UINT message, WPARAM wParam pa->bIsVisible = TRUE; pa->iOrder = accounts.getCount(); - pa->type = PROTOTYPE_PROTOCOL; break; } { @@ -195,7 +194,7 @@ static INT_PTR CALLBACK AccFormDlgProc(HWND hwndDlg, UINT message, WPARAM wParam if ( !db_get_b(NULL, "CList", "MoveProtoMenus", TRUE)) pa->ppro->OnEvent(EV_PROTO_ONMENU, 0, 0); } - else pa->type = PROTOTYPE_DISPROTO; + else pa->bDynDisabled = TRUE; } WriteDbAccounts(); @@ -779,7 +778,8 @@ INT_PTR CALLBACK AccMgrDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM if ( !db_get_b(NULL, "CList", "MoveProtoMenus", TRUE)) pa->ppro->OnEvent(EV_PROTO_ONMENU, 0, 0); } - else pa->type = PROTOTYPE_DISPROTO; } + else pa->bDynDisabled = TRUE; + } else { DWORD dwStatus = CallProtoServiceInt(NULL,pa->szModuleName, PS_GETSTATUS, 0, 0); if (dwStatus >= ID_STATUS_ONLINE) { -- cgit v1.2.3