summaryrefslogtreecommitdiff
path: root/src/modules/protocols
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-02-02 20:26:12 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-02-02 20:26:12 +0000
commit50b1df91f2a061776ec14528abcef27b4117604c (patch)
treec7c225947ad6f556fbe1ca4e163d5e67ae9d9410 /src/modules/protocols
parent3b7ef5348b728cbc916f5caa24938ff0581625cc (diff)
switch to modern helpers
git-svn-id: http://svn.miranda-ng.org/main/trunk@8018 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules/protocols')
-rw-r--r--src/modules/protocols/protoaccs.cpp18
1 files changed, 2 insertions, 16 deletions
diff --git a/src/modules/protocols/protoaccs.cpp b/src/modules/protocols/protoaccs.cpp
index 57cd4cad41..ea474771a7 100644
--- a/src/modules/protocols/protoaccs.cpp
+++ b/src/modules/protocols/protoaccs.cpp
@@ -549,28 +549,14 @@ void DeactivateAccount(PROTOACCOUNT* pa, bool bIsDynamic, bool bErase)
void EraseAccount(const char* pszModuleName)
{
- DBVARIANT dbv;
- DBCONTACTGETSETTING dbcgs;
- char szProtoName[32];
-
- dbcgs.pValue = &dbv;
- dbcgs.szModule = "Protocol";
- dbcgs.szSetting = "p";
-
// remove protocol contacts first
HANDLE hContact = db_find_first();
while (hContact != NULL) {
HANDLE h1 = hContact;
hContact = db_find_next(h1);
- dbv.type = DBVT_ASCIIZ;
- dbv.pszVal = szProtoName;
- dbv.cchVal = SIZEOF(szProtoName);
-
- if (CallService(MS_DB_CONTACT_GETSETTINGSTATIC, (WPARAM)h1, (LPARAM)&dbcgs))
- continue;
-
- if (!lstrcmpA(szProtoName, pszModuleName))
+ char *szProto = GetContactProto(hContact);
+ if (szProto != NULL && !lstrcmpA(szProto, pszModuleName))
CallService(MS_DB_CONTACT_DELETE, (WPARAM)h1, 0);
}