summaryrefslogtreecommitdiff
path: root/protocols/IcqOscarJ/src/icq_db.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-02-03 20:11:26 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-02-03 20:11:26 +0000
commite84b97a0622a26fe474ccd840dcadb320520601c (patch)
tree7c1725e6eddbb47d618c8574147dd998feb8ea52 /protocols/IcqOscarJ/src/icq_db.cpp
parente82c4d5d574191f432716049218b4b7b5162ec38 (diff)
- new helpers for reading db strings into static buffers;
- MS_DB_CONTACT_GETSETTINGSTATIC died; - DBCONTACTGETSETTING is detouched from all services; - these service calls are rewritten using parameters git-svn-id: http://svn.miranda-ng.org/main/trunk@8035 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/IcqOscarJ/src/icq_db.cpp')
-rw-r--r--protocols/IcqOscarJ/src/icq_db.cpp23
1 files changed, 3 insertions, 20 deletions
diff --git a/protocols/IcqOscarJ/src/icq_db.cpp b/protocols/IcqOscarJ/src/icq_db.cpp
index ecf76ebfc4..8841ce24fc 100644
--- a/protocols/IcqOscarJ/src/icq_db.cpp
+++ b/protocols/IcqOscarJ/src/icq_db.cpp
@@ -107,27 +107,10 @@ WORD CIcqProto::getContactStatus(HANDLE hContact)
int CIcqProto::getSettingStringStatic(HANDLE hContact, const char *szSetting, char *dest, int dest_len)
{
- DBVARIANT dbv = {DBVT_DELETED};
- DBCONTACTGETSETTING sVal = {0};
-
- dbv.pszVal = dest;
- dbv.cchVal = dest_len;
- dbv.type = DBVT_ASCIIZ;
-
- sVal.pValue = &dbv;
- sVal.szModule = m_szModuleName;
- sVal.szSetting = szSetting;
-
- if (CallService(MS_DB_CONTACT_GETSETTINGSTATIC, (WPARAM)hContact, (LPARAM)&sVal) != 0) {
- dbv.pszVal = dest;
- dbv.cchVal = dest_len;
- dbv.type = DBVT_UTF8;
-
- if (CallService(MS_DB_CONTACT_GETSETTINGSTATIC, (WPARAM)hContact, (LPARAM)&sVal) != 0)
- return 1; // nothing found
- }
+ if (!db_get_static(hContact, m_szModuleName, szSetting, dest, dest_len))
+ return 0;
- return (dbv.type != DBVT_ASCIIZ);
+ return db_get_static_utf(hContact, m_szModuleName, szSetting, dest, dest_len);
}
int CIcqProto::setSettingDouble(HANDLE hContact, const char *szSetting, double dValue)