From b0b7cd90e972155a488b017eae3122ca8ac11ca8 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 19 Nov 2012 15:22:11 +0000 Subject: - returned back SecureIM option for the extra icons usage; - code cleaning git-svn-id: http://svn.miranda-ng.org/main/trunk@2376 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/SecureIM/src/commonheaders.cpp | 72 ++++++++++++++++++---------------- 1 file changed, 39 insertions(+), 33 deletions(-) (limited to 'plugins/SecureIM/src/commonheaders.cpp') diff --git a/plugins/SecureIM/src/commonheaders.cpp b/plugins/SecureIM/src/commonheaders.cpp index 881e69c38d..b76e322a17 100644 --- a/plugins/SecureIM/src/commonheaders.cpp +++ b/plugins/SecureIM/src/commonheaders.cpp @@ -38,7 +38,8 @@ PLUGININFOEX pluginInfoEx = { MIID_SECUREIM }; -LPSTR myDBGetString(HANDLE hContact,const char *szModule,const char *szSetting) { +LPSTR myDBGetString(HANDLE hContact,const char *szModule,const char *szSetting) +{ char *val=NULL; DBVARIANT dbv; dbv.type = DBVT_ASCIIZ; @@ -50,7 +51,8 @@ LPSTR myDBGetString(HANDLE hContact,const char *szModule,const char *szSetting) } -LPSTR myDBGetStringDecode(HANDLE hContact,const char *szModule,const char *szSetting) { +LPSTR myDBGetStringDecode(HANDLE hContact,const char *szModule,const char *szSetting) +{ char *val = myDBGetString(hContact,szModule,szSetting); if (!val) return NULL; size_t len = strlen(val)+64; @@ -61,7 +63,8 @@ LPSTR myDBGetStringDecode(HANDLE hContact,const char *szModule,const char *szSet } -int myDBWriteStringEncode(HANDLE hContact,const char *szModule,const char *szSetting,const char *val) { +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); @@ -70,31 +73,32 @@ int myDBWriteStringEncode(HANDLE hContact,const char *szModule,const char *szSet return ret; } -void GetFlags() { - bSFT = DBGetContactSettingByte(0,szModuleName,"sft",0); - bSOM = DBGetContactSettingByte(0,szModuleName,"som",0); - bASI = DBGetContactSettingByte(0,szModuleName,"asi",0); - bMCD = DBGetContactSettingByte(0,szModuleName,"mcd",0); - bSCM = DBGetContactSettingByte(0,szModuleName,"scm",0); - bDGP = DBGetContactSettingByte(0,szModuleName,"dgp",0); - bAIP = DBGetContactSettingByte(0,szModuleName,"aip",0); - bNOL = DBGetContactSettingByte(0,szModuleName,"nol",0); - bAAK = DBGetContactSettingByte(0,szModuleName,"aak",0); - bMCM = DBGetContactSettingByte(0,szModuleName,"mcm",0); +void GetFlags() +{ + bSFT = db_get_b(0, szModuleName, "sft", 0); + bSOM = db_get_b(0, szModuleName, "som", 0); + bASI = db_get_b(0, szModuleName, "asi", 0); + bMCD = db_get_b(0, szModuleName, "mcd", 0); + bSCM = db_get_b(0, szModuleName, "scm", 0); + bDGP = db_get_b(0, szModuleName, "dgp", 0); + bAIP = db_get_b(0, szModuleName, "aip", 0); + bNOL = db_get_b(0, szModuleName, "nol", 0); + bAAK = db_get_b(0, szModuleName, "aak", 0); + bMCM = db_get_b(0, szModuleName, "mcm", 0); } - -void SetFlags() { - DBWriteContactSettingByte(0,szModuleName,"sft",bSFT); - DBWriteContactSettingByte(0,szModuleName,"som",bSOM); - DBWriteContactSettingByte(0,szModuleName,"asi",bASI); - DBWriteContactSettingByte(0,szModuleName,"mcd",bMCD); - DBWriteContactSettingByte(0,szModuleName,"scm",bSCM); - DBWriteContactSettingByte(0,szModuleName,"dgp",bDGP); - DBWriteContactSettingByte(0,szModuleName,"aip",bAIP); - DBWriteContactSettingByte(0,szModuleName,"nol",bNOL); - DBWriteContactSettingByte(0,szModuleName,"aak",bAAK); - DBWriteContactSettingByte(0,szModuleName,"mcm",bMCM); +void SetFlags() +{ + db_set_b(0, szModuleName, "sft", bSFT); + db_set_b(0, szModuleName, "som", bSOM); + db_set_b(0, szModuleName, "asi", bASI); + db_set_b(0, szModuleName, "mcd", bMCD); + db_set_b(0, szModuleName, "scm", bSCM); + db_set_b(0, szModuleName, "dgp", bDGP); + db_set_b(0, szModuleName, "aip", bAIP); + db_set_b(0, szModuleName, "nol", bNOL); + db_set_b(0, szModuleName, "aak", bAAK); + db_set_b(0, szModuleName, "mcm", bMCM); } struct A2U { @@ -106,7 +110,8 @@ typedef A2U* pA2U; pA2U pa2u; int ca2u=0; -LPSTR TranslateU( LPCSTR lpText ) { +LPSTR TranslateU( LPCSTR lpText ) +{ int i; for(i=0;i