summaryrefslogtreecommitdiff
path: root/protocols/IcqOscarJ/src/icq_servlist.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_servlist.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_servlist.cpp')
-rw-r--r--protocols/IcqOscarJ/src/icq_servlist.cpp24
1 files changed, 3 insertions, 21 deletions
diff --git a/protocols/IcqOscarJ/src/icq_servlist.cpp b/protocols/IcqOscarJ/src/icq_servlist.cpp
index 44e6ef480e..5eac04a78b 100644
--- a/protocols/IcqOscarJ/src/icq_servlist.cpp
+++ b/protocols/IcqOscarJ/src/icq_servlist.cpp
@@ -930,28 +930,10 @@ static int GroupReserveIdsEnumProc(const char *szSetting,LPARAM lParam)
// it is probably server group
GroupReserveIdsEnumParam *param = (GroupReserveIdsEnumParam*)lParam;
char val[MAX_PATH+2]; // dummy
-
- DBVARIANT dbv = {DBVT_DELETED};
- dbv.type = DBVT_ASCIIZ;
- dbv.pszVal = val;
- dbv.cchVal = MAX_PATH;
-
- DBCONTACTGETSETTING cgs;
- cgs.szModule = param->szModule;
- cgs.szSetting = szSetting;
- cgs.pValue = &dbv;
- if (CallService(MS_DB_CONTACT_GETSETTINGSTATIC,0,(LPARAM)&cgs))
- { // we failed to read setting, try also utf8 - DB bug
- dbv.type = DBVT_UTF8;
- dbv.pszVal = val;
- dbv.cchVal = MAX_PATH;
- if (CallService(MS_DB_CONTACT_GETSETTINGSTATIC,0,(LPARAM)&cgs))
+ if (db_get_static(0, param->szModule, szSetting, val, MAX_PATH))
+ if (db_get_static_utf(0, param->szModule, szSetting, val, MAX_PATH))
return 0; // we failed also, invalid setting
- }
- if (dbv.type != DBVT_ASCIIZ)
- { // it is not a cached server-group name
- return 0;
- }
+
param->ppro->ReserveServerID((WORD)strtoul(szSetting, NULL, 0x10), SSIT_GROUP, 0);
#ifdef _DEBUG
param->ppro->debugLogA("Loaded group %u:'%s'", strtoul(szSetting, NULL, 0x10), val);