summaryrefslogtreecommitdiff
path: root/plugins/SecureIM/src/commonheaders.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-03-31 19:09:56 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-03-31 19:09:56 +0000
commit33ed395de0eb385315d949c77b4e1289a6684112 (patch)
tree6698849d0a9396582130b7b2758565566b72f694 /plugins/SecureIM/src/commonheaders.cpp
parentcecb2a6e6e221b6cb94e48ef601d12bfde7f60f4 (diff)
code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@4267 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/SecureIM/src/commonheaders.cpp')
-rw-r--r--plugins/SecureIM/src/commonheaders.cpp20
1 files changed, 3 insertions, 17 deletions
diff --git a/plugins/SecureIM/src/commonheaders.cpp b/plugins/SecureIM/src/commonheaders.cpp
index 5895a51b04..ed88af67f9 100644
--- a/plugins/SecureIM/src/commonheaders.cpp
+++ b/plugins/SecureIM/src/commonheaders.cpp
@@ -37,22 +37,9 @@ PLUGININFOEX pluginInfoEx = {
{0x1B2A39E5, 0xE2F6, 0x494D, {0x95, 0x8D, 0x18, 0x08, 0xFD, 0x11, 0x0D, 0xD5}}
};
-LPSTR myDBGetString(HANDLE hContact, const char *szModule, const char *szSetting)
-{
- char *val=NULL;
- DBVARIANT dbv;
- dbv.type = DBVT_ASCIIZ;
- DBGetContactSetting(hContact,szModule,szSetting,&dbv);
- if ( dbv.pszVal && (dbv.type==DBVT_ASCIIZ || dbv.type==DBVT_UTF8 || dbv.type==DBVT_WCHAR))
- val = mir_strdup(dbv.pszVal);
- DBFreeVariant(&dbv);
- return val;
-}
-
-
LPSTR myDBGetStringDecode(HANDLE hContact,const char *szModule,const char *szSetting)
{
- char *val = myDBGetString(hContact,szModule,szSetting);
+ char *val = db_get_sa(hContact,szModule,szSetting);
if (!val) return NULL;
size_t len = strlen(val)+64;
char *buf = (LPSTR)mir_alloc(len);
@@ -61,14 +48,13 @@ LPSTR myDBGetStringDecode(HANDLE hContact,const char *szModule,const char *szSet
return buf;
}
-
int myDBWriteStringEncode(HANDLE hContact,const char *szModule,const char *szSetting,const char *val)
{
int len = (int)strlen(val)+64;
char *buf = (LPSTR)alloca(len);
strncpy(buf,val,len);
CallService(MS_DB_CRYPT_ENCODESTRING,(WPARAM)len,(LPARAM)buf);
- int ret = DBWriteContactSettingString(hContact,szModule,szSetting,buf);
+ int ret = db_set_s(hContact,szModule,szSetting,buf);
return ret;
}
@@ -112,7 +98,7 @@ int ca2u=0;
LPSTR TranslateU( LPCSTR lpText )
{
int i;
- for(i=0;i<ca2u;i++) {
+ for (i=0;i<ca2u;i++) {
if ( pa2u[i].a == lpText ) {
return pa2u[i].u;
}