summaryrefslogtreecommitdiff
path: root/protocols/MRA/src
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/MRA/src')
-rw-r--r--protocols/MRA/src/MraAntiSpam.cpp13
-rw-r--r--protocols/MRA/src/Mra_functions.cpp23
2 files changed, 6 insertions, 30 deletions
diff --git a/protocols/MRA/src/MraAntiSpam.cpp b/protocols/MRA/src/MraAntiSpam.cpp
index 2eaa64348e..e3bc5edd82 100644
--- a/protocols/MRA/src/MraAntiSpam.cpp
+++ b/protocols/MRA/src/MraAntiSpam.cpp
@@ -17,15 +17,8 @@ static size_t dwBadWordsCount = 0;
size_t MraAntiSpamLoadBadWordsW()
{
- char szSettingName[MAX_PATH];
- size_t i = 0, dwValueSize, dwAllocatedItemsCount = MRA_ANTISPAM_PREALLOC_COUNT;
DBVARIANT dbv = {0};
- DBCONTACTGETSETTING sVal = {0};
-
- dbv.type = DBVT_WCHAR;
- sVal.pValue = &dbv;
- sVal.szModule = "MRA";
- sVal.szSetting = szSettingName;
+ size_t i = 0, dwValueSize, dwAllocatedItemsCount = MRA_ANTISPAM_PREALLOC_COUNT;
if (pmabwBadWords || dwBadWordsCount)
MraAntiSpamFreeBadWords();
@@ -33,9 +26,9 @@ size_t MraAntiSpamLoadBadWordsW()
pmabwBadWords = (MRA_ANTISPAM_BAD_WORD*)mir_calloc((sizeof(MRA_ANTISPAM_BAD_WORD)*dwAllocatedItemsCount));
for (i = 0;TRUE;i++) {
+ char szSettingName[MAX_PATH];
mir_snprintf(szSettingName, SIZEOF(szSettingName), "AntiSpamBadWord %lu", i);
- dbv.type = DBVT_WCHAR;
- if (CallService(MS_DB_CONTACT_GETSETTING_STR, NULL, (LPARAM)&sVal))
+ if (db_get_ws(NULL, "MRA", szSettingName, &dbv))
break;
if (dwAllocatedItemsCount == i) {
diff --git a/protocols/MRA/src/Mra_functions.cpp b/protocols/MRA/src/Mra_functions.cpp
index d4a5f657ac..65ed85f6c1 100644
--- a/protocols/MRA/src/Mra_functions.cpp
+++ b/protocols/MRA/src/Mra_functions.cpp
@@ -207,13 +207,7 @@ BOOL DB_GetStaticStringA(HANDLE hContact, LPCSTR lpszModule, LPCSTR lpszValueNam
BOOL bRet = FALSE;
size_t dwReadedStringLen, dwRetBuffSizeLocal;
DBVARIANT dbv = {0};
- DBCONTACTGETSETTING sVal = {0};
-
- dbv.type = DBVT_WCHAR;
- sVal.pValue = &dbv;
- sVal.szModule = lpszModule;
- sVal.szSetting = lpszValueName;
- if (CallService(MS_DB_CONTACT_GETSETTING_STR, (WPARAM)hContact, (LPARAM)&sVal) == 0)
+ if (db_get_ws(hContact, lpszModule, lpszValueName, &dbv) == 0)
{
dwReadedStringLen = lstrlenW(dbv.pwszVal);
if (lpszRetBuff && (dwRetBuffSize>dwReadedStringLen))
@@ -241,13 +235,7 @@ BOOL DB_GetStaticStringW(HANDLE hContact, LPCSTR lpszModule, LPCSTR lpszValueNam
BOOL bRet = FALSE;
size_t dwReadedStringLen;
DBVARIANT dbv = {0};
- DBCONTACTGETSETTING sVal = {0};
-
- dbv.type = DBVT_WCHAR;
- sVal.pValue = &dbv;
- sVal.szModule = lpszModule;
- sVal.szSetting = lpszValueName;
- if (CallService(MS_DB_CONTACT_GETSETTING_STR, (WPARAM)hContact, (LPARAM)&sVal) == 0)
+ if (db_get_ws(hContact, lpszModule, lpszValueName, &dbv) == 0)
{
dwReadedStringLen = lstrlenW(dbv.pwszVal);
if (lpwszRetBuff && (dwRetBuffSize>dwReadedStringLen))
@@ -344,12 +332,7 @@ BOOL DB_GetContactSettingBlob(HANDLE hContact, LPCSTR lpszModule, LPCSTR lpszVal
{
BOOL bRet = FALSE;
DBVARIANT dbv;
- DBCONTACTGETSETTING sVal = {0};
-
- sVal.pValue = &dbv;
- sVal.szModule = lpszModule;
- sVal.szSetting = lpszValueName;
- if (CallService(MS_DB_CONTACT_GETSETTING, (WPARAM)hContact, (LPARAM)&sVal) == 0)
+ if (db_get(hContact, lpszModule, lpszValueName, &dbv) == 0)
{
if (dbv.type == DBVT_BLOB)
{