diff options
author | George Hazan <george.hazan@gmail.com> | 2014-03-15 09:15:41 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-03-15 09:15:41 +0000 |
commit | e624b1dcc719be421ed8530885ca1b259fe59fdf (patch) | |
tree | c394f1acd8a324a16523620304bd2b8d8fafd0a6 /src/modules/protocols | |
parent | 4ce98069fa28c62534c1c86f00b644fc29f7026d (diff) |
PROTOACCOUNT::bIsVirtual - new flag to mark virtual protocols
git-svn-id: http://svn.miranda-ng.org/main/trunk@8609 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules/protocols')
-rw-r--r-- | src/modules/protocols/protoaccs.cpp | 15 | ||||
-rw-r--r-- | src/modules/protocols/protocols.cpp | 5 |
2 files changed, 11 insertions, 9 deletions
diff --git a/src/modules/protocols/protoaccs.cpp b/src/modules/protocols/protoaccs.cpp index 33c5a83ba2..183e72b0f8 100644 --- a/src/modules/protocols/protoaccs.cpp +++ b/src/modules/protocols/protoaccs.cpp @@ -84,7 +84,7 @@ void LoadDbAccounts(void) db_free(&dbv);
_itoa(OFFSET_VISIBLE+i, buf, 10);
- pa->bIsVisible = db_get_dw(NULL, "Protocols", buf, 1);
+ pa->bIsVisible = db_get_dw(NULL, "Protocols", buf, 1) != 0;
_itoa(OFFSET_PROTOPOS+i, buf, 10);
pa->iOrder = db_get_dw(NULL, "Protocols", buf, 1);
@@ -98,14 +98,14 @@ void LoadDbAccounts(void) }
_itoa(OFFSET_ENABLED+i, buf, 10);
- pa->bIsEnabled = db_get_dw(NULL, "Protocols", buf, 1);
+ pa->bIsEnabled = db_get_dw(NULL, "Protocols", buf, 1) != 0;
if (!db_get_s(NULL, pa->szModuleName, "AM_BaseProto", &dbv)) {
pa->szProtoName = mir_strdup(dbv.pszVal);
db_free(&dbv);
}
}
- else pa->bIsEnabled = TRUE;
+ else pa->bIsEnabled = true;
if (!pa->szProtoName) {
pa->szProtoName = mir_strdup(pa->szModuleName);
@@ -118,11 +118,13 @@ void LoadDbAccounts(void) accounts.insert(pa);
}
- if (CheckProtocolOrder()) WriteDbAccounts();
+ if (CheckProtocolOrder())
+ WriteDbAccounts();
int anum = accounts.getCount();
CallService(MS_DB_MODULES_ENUM, 0, (LPARAM)EnumDbModules);
- if (anum != accounts.getCount()) WriteDbAccounts();
+ if (anum != accounts.getCount())
+ WriteDbAccounts();
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -422,7 +424,6 @@ static HANDLE CreateProtoServiceEx(const char* szModule, const char* szService, BOOL ActivateAccount(PROTOACCOUNT *pa)
{
- PROTO_INTERFACE* ppi;
PROTOCOLDESCRIPTOR* ppd = Proto_IsProtocolLoaded(pa->szProtoName);
if (ppd == NULL)
return FALSE;
@@ -430,7 +431,7 @@ BOOL ActivateAccount(PROTOACCOUNT *pa) if (ppd->fnInit == NULL)
return FALSE;
- ppi = ppd->fnInit(pa->szModuleName, pa->tszAccountName);
+ PROTO_INTERFACE *ppi = ppd->fnInit(pa->szModuleName, pa->tszAccountName);
if (ppi == NULL)
return FALSE;
diff --git a/src/modules/protocols/protocols.cpp b/src/modules/protocols/protocols.cpp index 0191d62d7c..b93b9dc25a 100644 --- a/src/modules/protocols/protocols.cpp +++ b/src/modules/protocols/protocols.cpp @@ -120,11 +120,12 @@ static INT_PTR Proto_RegisterModule(WPARAM, LPARAM lParam) pa->szModuleName = mir_strdup(pd->szName);
pa->szProtoName = mir_strdup(pd->szName);
pa->tszAccountName = mir_a2t(pd->szName);
- pa->bIsVisible = pa->bIsEnabled = TRUE;
+ pa->bIsVisible = pa->bIsEnabled = true;
+ pa->bIsVirtual = (p->type == PROTOTYPE_VIRTUAL);
pa->iOrder = accounts.getCount();
accounts.insert(pa);
}
- pa->bOldProto = TRUE;
+ pa->bOldProto = true;
pa->ppro = ppi;
p->fnInit = defInitProto;
p->fnUninit = FreeDefaultAccount;
|