summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/Clist_mw/src/clistsettings.cpp13
-rw-r--r--plugins/RemovePersonalSettings/src/rps.cpp16
-rw-r--r--src/modules/protocols/protoaccs.cpp18
3 files changed, 4 insertions, 43 deletions
diff --git a/plugins/Clist_mw/src/clistsettings.cpp b/plugins/Clist_mw/src/clistsettings.cpp
index 7e6b081d80..ed3573d6d7 100644
--- a/plugins/Clist_mw/src/clistsettings.cpp
+++ b/plugins/Clist_mw/src/clistsettings.cpp
@@ -203,18 +203,7 @@ char *GetContactCachedProtocol(HANDLE hContact)
char *GetProtoForContact(HANDLE hContact)
{
- DBVARIANT dbv;
- DBCONTACTGETSETTING dbcgs;
- char name[32];
-
- dbv.type = DBVT_ASCIIZ;
- dbv.pszVal = name;
- dbv.cchVal = SIZEOF(name);
- dbcgs.pValue = &dbv;
- dbcgs.szModule = "Protocol";
- dbcgs.szSetting = "p";
- if (CallService(MS_DB_CONTACT_GETSETTINGSTATIC,(WPARAM)hContact,(LPARAM)&dbcgs)) return NULL;
- return mir_strdup(dbcgs.pValue->pszVal);
+ return mir_strdup(GetContactProto(hContact));
}
int GetStatusForContact(HANDLE hContact,char *szProto)
diff --git a/plugins/RemovePersonalSettings/src/rps.cpp b/plugins/RemovePersonalSettings/src/rps.cpp
index 181248d616..d1e8a698ea 100644
--- a/plugins/RemovePersonalSettings/src/rps.cpp
+++ b/plugins/RemovePersonalSettings/src/rps.cpp
@@ -616,21 +616,7 @@ void DeleteFileOrFolder(const char *name)
BOOL isMetaContact(HANDLE hContact)
{
- DBVARIANT dbv;
- DBCONTACTGETSETTING dbcgs;
- char name[32];
-
- dbv.type=DBVT_ASCIIZ;
- dbv.pszVal=name;
- dbv.cchVal=sizeof(name);
- dbcgs.pValue=&dbv;
- dbcgs.szModule="Protocol";
- dbcgs.szSetting="p";
-
- if(CallService(MS_DB_CONTACT_GETSETTINGSTATIC,(WPARAM)hContact,(LPARAM)&dbcgs))
- return FALSE;
-
- return strcmp(dbcgs.pValue->pszVal, METACONTACTS_PROTOCOL_NAME) == 0;
+ return lstrcmpA(GetContactProto(hContact), METACONTACTS_PROTOCOL_NAME) == 0;
}
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);
}