diff options
author | George Hazan <george.hazan@gmail.com> | 2012-11-19 15:22:11 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-11-19 15:22:11 +0000 |
commit | b0b7cd90e972155a488b017eae3122ca8ac11ca8 (patch) | |
tree | 492b159a318acefcebb522959123a0ee7e0c71d8 /plugins/SecureIM/src | |
parent | 753aa1585f9e0939cba3073f8ef2c70972a47b62 (diff) |
- 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
Diffstat (limited to 'plugins/SecureIM/src')
-rw-r--r-- | plugins/SecureIM/src/commonheaders.cpp | 72 | ||||
-rw-r--r-- | plugins/SecureIM/src/crypt_check.cpp | 8 | ||||
-rw-r--r-- | plugins/SecureIM/src/crypt_dll.cpp | 2 | ||||
-rw-r--r-- | plugins/SecureIM/src/crypt_icons.cpp | 3 | ||||
-rw-r--r-- | plugins/SecureIM/src/crypt_lists.cpp | 8 | ||||
-rw-r--r-- | plugins/SecureIM/src/crypt_popups.cpp | 16 | ||||
-rw-r--r-- | plugins/SecureIM/src/main.cpp | 12 | ||||
-rw-r--r-- | plugins/SecureIM/src/options.cpp | 57 | ||||
-rw-r--r-- | plugins/SecureIM/src/popupOptions.cpp | 12 | ||||
-rw-r--r-- | plugins/SecureIM/src/svcs_menu.cpp | 8 | ||||
-rw-r--r-- | plugins/SecureIM/src/svcs_proto.cpp | 14 | ||||
-rw-r--r-- | plugins/SecureIM/src/svcs_rsa.cpp | 2 |
12 files changed, 111 insertions, 103 deletions
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<ca2u;i++) {
if ( pa2u[i].a == lpText ) {
@@ -132,7 +137,8 @@ LPSTR TranslateU( LPCSTR lpText ) { return pa2u[i].u;
}
-int msgbox( HWND hWnd, LPCSTR lpText, LPCSTR lpCaption, UINT uType) {
+int msgbox( HWND hWnd, LPCSTR lpText, LPCSTR lpCaption, UINT uType)
+{
if ( bCoreUnicode ) {
LPWSTR lpwText = mir_a2u(lpText);
LPWSTR lpwCaption = mir_a2u(lpCaption);
@@ -163,10 +169,9 @@ void CopyToClipboard(HWND hwnd,LPSTR msg) #if defined(_DEBUG) || defined(NETLIB_LOG)
HANDLE hNetlibUser;
-void InitNetlib() {
- NETLIBUSER nl_user;
- memset(&nl_user,0,sizeof(nl_user));
- nl_user.cbSize = sizeof(nl_user);
+void InitNetlib()
+{
+ NETLIBUSER nl_user = { sizeof(nl_user) };
nl_user.szSettingsModule = (LPSTR)szModuleName;
nl_user.szDescriptiveName = (LPSTR)szModuleName;
nl_user.flags = NUF_NOOPTIONS;
@@ -174,7 +179,8 @@ void InitNetlib() { hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nl_user);
}
-void DeinitNetlib() {
+void DeinitNetlib()
+{
if(hNetlibUser)
CallService(MS_NETLIB_CLOSEHANDLE, (WPARAM)hNetlibUser, 0);
}
diff --git a/plugins/SecureIM/src/crypt_check.cpp b/plugins/SecureIM/src/crypt_check.cpp index 3a4a0e0c30..ad15f3f9de 100644 --- a/plugins/SecureIM/src/crypt_check.cpp +++ b/plugins/SecureIM/src/crypt_check.cpp @@ -107,7 +107,7 @@ BOOL isProtoSmallPackets(HANDLE hContact) { BOOL isContactInvisible(HANDLE hContact) {
- if ( !DBGetContactSettingByte(hContact,"CList","Hidden",0)) {
+ if ( !db_get_b(hContact,"CList","Hidden",0)) {
if ( !clist_cnt ) return false;
for(int j=0;j<clist_cnt;j++) {
if ( clist[j].hContact == hContact ) {
@@ -130,7 +130,7 @@ BOOL isContactInvisible(HANDLE hContact) { BOOL isNotOnList(HANDLE hContact) {
- return DBGetContactSettingByte(hContact, "CList", "NotOnList", 0);
+ return db_get_b(hContact, "CList", "NotOnList", 0);
}
@@ -220,7 +220,7 @@ BOOL isChatRoom(HANDLE hContact) { for(int j=0;j<clist_cnt;j++) {
if ( clist[j].hContact == hContact ) {
if ( !clist[j].proto->inspecting ) break;
- return (DBGetContactSettingByte(hContact,clist[j].proto->name,"ChatRoom",0)!=0);
+ return (db_get_b(hContact,clist[j].proto->name,"ChatRoom",0)!=0);
}
}
return false;
@@ -238,7 +238,7 @@ BOOL isSecureIM(pUinKey ptr, BOOL emptyMirverAsSecureIM) { if ( !ptr->proto->inspecting ) return false;
BOOL isSecureIM = false;
- if ( bNOL && DBGetContactSettingByte(ptr->hContact,"CList","NotOnList",0)) {
+ if ( bNOL && db_get_b(ptr->hContact,"CList","NotOnList",0)) {
return false;
}
LPSTR mirver = myDBGetString(ptr->hContact,ptr->proto->name,"MirVer");
diff --git a/plugins/SecureIM/src/crypt_dll.cpp b/plugins/SecureIM/src/crypt_dll.cpp index 6a97021886..e7779831ff 100644 --- a/plugins/SecureIM/src/crypt_dll.cpp +++ b/plugins/SecureIM/src/crypt_dll.cpp @@ -200,7 +200,7 @@ LPSTR decodeMsg(pUinKey ptr, LPARAM lParam, LPSTR szEncMsg) { BOOL LoadKeyPGP(pUinKey ptr) {
- int mode = DBGetContactSettingByte(ptr->hContact,szModuleName,"pgp_mode",255);
+ int mode = db_get_b(ptr->hContact,szModuleName,"pgp_mode",255);
if(mode==0) {
DBVARIANT dbv;
DBGetContactSetting(ptr->hContact,szModuleName,"pgp",&dbv);
diff --git a/plugins/SecureIM/src/crypt_icons.cpp b/plugins/SecureIM/src/crypt_icons.cpp index 917d3e1682..791fd1fd24 100644 --- a/plugins/SecureIM/src/crypt_icons.cpp +++ b/plugins/SecureIM/src/crypt_icons.cpp @@ -47,6 +47,9 @@ HICON mode2icon(int mode, int type) HANDLE mode2clicon(int mode, int type)
{
+ if (!bASI)
+ return INVALID_HANDLE_VALUE;
+
ICON_CACHE &p = getCacheItem(mode, type);
if (p.hCLIcon == NULL)
p.hCLIcon = (HANDLE)CallService(MS_CLIST_EXTRA_ADD_ICON, (WPARAM)p.icon, 0);
diff --git a/plugins/SecureIM/src/crypt_lists.cpp b/plugins/SecureIM/src/crypt_lists.cpp index 177d5756e6..97b3c1ee3e 100644 --- a/plugins/SecureIM/src/crypt_lists.cpp +++ b/plugins/SecureIM/src/crypt_lists.cpp @@ -95,17 +95,17 @@ pUinKey addContact(HANDLE hContact) { clist[j].footer = FOOTER;
clist[j].hContact = hContact;
clist[j].proto = proto;
- clist[j].mode = DBGetContactSettingByte(hContact, szModuleName, "mode", 99);
+ clist[j].mode = db_get_b(hContact, szModuleName, "mode", 99);
if ( clist[j].mode == 99 ) {
if ( isContactPGP(hContact)) clist[j].mode = MODE_PGP;
else
if ( isContactGPG(hContact)) clist[j].mode = MODE_GPG;
else
clist[j].mode = MODE_RSAAES;
- DBWriteContactSettingByte(hContact, szModuleName, "mode", clist[j].mode);
+ db_set_b(hContact, szModuleName, "mode", clist[j].mode);
}
- clist[j].status = DBGetContactSettingByte(hContact, szModuleName, "StatusID", STATUS_ENABLED);
- clist[j].gpgMode = DBGetContactSettingByte(hContact, szModuleName, "gpgANSI", 0);
+ clist[j].status = db_get_b(hContact, szModuleName, "StatusID", STATUS_ENABLED);
+ clist[j].gpgMode = db_get_b(hContact, szModuleName, "gpgANSI", 0);
return &clist[j];
}
}
diff --git a/plugins/SecureIM/src/crypt_popups.cpp b/plugins/SecureIM/src/crypt_popups.cpp index 836a68efc1..924719bb4b 100644 --- a/plugins/SecureIM/src/crypt_popups.cpp +++ b/plugins/SecureIM/src/crypt_popups.cpp @@ -115,36 +115,36 @@ void showPopUp(LPCSTR lpzText,HANDLE hContact,HICON hIcon, UINT type) { void showPopUpDCmsg(HANDLE hContact,LPCSTR msg) {
- int indic=DBGetContactSettingByte(0, szModuleName, "dc",1);
+ int indic=db_get_b(0, szModuleName, "dc",1);
if (indic==1) showPopUp(msg,hContact,g_hPOP[POP_PU_DIS],1);
}
void showPopUpDC(HANDLE hContact) {
- int indic=DBGetContactSettingByte(0, szModuleName, "dc",1);
+ int indic=db_get_b(0, szModuleName, "dc",1);
if (indic==1) showPopUp(sim006,hContact,g_hPOP[POP_PU_DIS],1);
}
void showPopUpEC(HANDLE hContact) {
- int indic=DBGetContactSettingByte(0, szModuleName, "ec",1);
+ int indic=db_get_b(0, szModuleName, "ec",1);
if (indic==1) showPopUp(sim001,hContact,g_hPOP[POP_PU_EST],1);
}
void showPopUpKS(HANDLE hContact) {
- int indic=DBGetContactSettingByte(0, szModuleName, "ks",1);
+ int indic=db_get_b(0, szModuleName, "ks",1);
if (indic==1) showPopUp(sim007,hContact,g_hPOP[POP_PU_PRC],0);
}
void showPopUpKRmsg(HANDLE hContact,LPCSTR msg) {
- int indic=DBGetContactSettingByte(0, szModuleName, "kr",1);
+ int indic=db_get_b(0, szModuleName, "kr",1);
if (indic==1) showPopUp(msg,hContact,g_hPOP[POP_PU_PRC],0);
}
void showPopUpKR(HANDLE hContact) {
- int indic=DBGetContactSettingByte(0, szModuleName, "kr",1);
+ int indic=db_get_b(0, szModuleName, "kr",1);
if (indic==1) showPopUp(sim008,hContact,g_hPOP[POP_PU_PRC],0);
}
void showPopUpSM(HANDLE hContact) {
- int indic=DBGetContactSettingByte(0, szModuleName, "ss",0);
+ int indic=db_get_b(0, szModuleName, "ss",0);
if (indic==1) showPopUp(sim009,hContact,g_hPOP[POP_PU_MSS],2);
SkinPlaySound("OutgoingSecureMessage");
}
void showPopUpRM(HANDLE hContact) {
- int indic=DBGetContactSettingByte(0, szModuleName, "sr",0);
+ int indic=db_get_b(0, szModuleName, "sr",0);
if (indic==1) showPopUp(sim010,hContact,g_hPOP[POP_PU_MSR],2);
SkinPlaySound("IncomingSecureMessage");
}
diff --git a/plugins/SecureIM/src/main.cpp b/plugins/SecureIM/src/main.cpp index 23ee788a76..de8015d342 100644 --- a/plugins/SecureIM/src/main.cpp +++ b/plugins/SecureIM/src/main.cpp @@ -238,10 +238,10 @@ int __cdecl onModulesLoaded(WPARAM wParam,LPARAM lParam) { #if defined(_DEBUG) || defined(NETLIB_LOG)
Sent_NetLog("pgp_init");
#endif
- bPGP = DBGetContactSettingByte(0, szModuleName, "pgp", 0);
+ bPGP = db_get_b(0, szModuleName, "pgp", 0);
if(bPGP) { //PGP
bPGPloaded = pgp_init();
- bUseKeyrings = DBGetContactSettingByte(0,szModuleName,"ukr",1);
+ bUseKeyrings = db_get_b(0,szModuleName,"ukr",1);
LPSTR priv = myDBGetStringDecode(0,szModuleName,"pgpPrivKey");
if(priv) {
bPGPprivkey = true;
@@ -285,7 +285,7 @@ int __cdecl onModulesLoaded(WPARAM wParam,LPARAM lParam) { #if defined(_DEBUG) || defined(NETLIB_LOG)
Sent_NetLog("gpg_init");
#endif
- bGPG = DBGetContactSettingByte(0, szModuleName, "gpg", 0);
+ bGPG = db_get_b(0, szModuleName, "gpg", 0);
if(bGPG) { //GPG
LPSTR tmp;
@@ -306,7 +306,7 @@ int __cdecl onModulesLoaded(WPARAM wParam,LPARAM lParam) { mir_free(tmp);
}
- if(DBGetContactSettingByte(0, szModuleName, "gpgLogFlag",0)) {
+ if(db_get_b(0, szModuleName, "gpgLogFlag",0)) {
tmp = myDBGetString(0,szModuleName,"gpgLog");
if(tmp) {
gpg_set_log(tmp);
@@ -314,7 +314,7 @@ int __cdecl onModulesLoaded(WPARAM wParam,LPARAM lParam) { }
}
- if(DBGetContactSettingByte(0, szModuleName, "gpgTmpFlag",0)) {
+ if(db_get_b(0, szModuleName, "gpgTmpFlag",0)) {
tmp = myDBGetString(0,szModuleName,"gpgTmp");
if(tmp) {
gpg_set_tmp(tmp);
@@ -332,7 +332,7 @@ int __cdecl onModulesLoaded(WPARAM wParam,LPARAM lParam) { DBDeleteContactSetting(0, szModuleName, "gpgHome");
}
- bSavePass = DBGetContactSettingByte(0,szModuleName,"gpgSaveFlag",0);
+ bSavePass = db_get_b(0,szModuleName,"gpgSaveFlag",0);
if(bSavePass) {
tmp = myDBGetString(0,szModuleName,"gpgSave");
if(tmp) {
diff --git a/plugins/SecureIM/src/options.cpp b/plugins/SecureIM/src/options.cpp index a8ac1c72bf..26eeb0f1ee 100644 --- a/plugins/SecureIM/src/options.cpp +++ b/plugins/SecureIM/src/options.cpp @@ -1113,20 +1113,20 @@ void RefreshGeneralDlg(HWND hDlg, BOOL iInit) { GetFlags();
- SendMessage(GetDlgItem(hDlg,IDC_SFT),BM_SETCHECK,(bSFT)?BST_CHECKED:BST_UNCHECKED,0L);
- SendMessage(GetDlgItem(hDlg,IDC_SOM),BM_SETCHECK,(bSOM)?BST_CHECKED:BST_UNCHECKED,0L);
- SendMessage(GetDlgItem(hDlg,IDC_ASI),BM_SETCHECK,(bASI)?BST_CHECKED:BST_UNCHECKED,0L);
- SendMessage(GetDlgItem(hDlg,IDC_MCD),BM_SETCHECK,(bMCD)?BST_CHECKED:BST_UNCHECKED,0L);
- SendMessage(GetDlgItem(hDlg,IDC_SCM),BM_SETCHECK,(bSCM)?BST_CHECKED:BST_UNCHECKED,0L);
- SendMessage(GetDlgItem(hDlg,IDC_DGP),BM_SETCHECK,(bDGP)?BST_CHECKED:BST_UNCHECKED,0L);
- SendMessage(GetDlgItem(hDlg,IDC_AIP),BM_SETCHECK,(bAIP)?BST_CHECKED:BST_UNCHECKED,0L);
- SendMessage(GetDlgItem(hDlg,IDC_NOL),BM_SETCHECK,(bNOL)?BST_CHECKED:BST_UNCHECKED,0L);
- SendMessage(GetDlgItem(hDlg,IDC_AAK),BM_SETCHECK,(bAAK)?BST_CHECKED:BST_UNCHECKED,0L);
- SendMessage(GetDlgItem(hDlg,IDC_MCM),BM_SETCHECK,(bMCM)?BST_CHECKED:BST_UNCHECKED,0L);
+ SendMessage( GetDlgItem(hDlg,IDC_SFT), BM_SETCHECK, (bSFT) ? BST_CHECKED : BST_UNCHECKED, 0);
+ SendMessage( GetDlgItem(hDlg,IDC_SOM), BM_SETCHECK, (bSOM) ? BST_CHECKED : BST_UNCHECKED, 0);
+ SendMessage( GetDlgItem(hDlg,IDC_ASI), BM_SETCHECK, (bASI) ? BST_CHECKED : BST_UNCHECKED, 0);
+ SendMessage( GetDlgItem(hDlg,IDC_MCD), BM_SETCHECK, (bMCD) ? BST_CHECKED : BST_UNCHECKED, 0);
+ SendMessage( GetDlgItem(hDlg,IDC_SCM), BM_SETCHECK, (bSCM) ? BST_CHECKED : BST_UNCHECKED, 0);
+ SendMessage( GetDlgItem(hDlg,IDC_DGP), BM_SETCHECK, (bDGP) ? BST_CHECKED : BST_UNCHECKED, 0);
+ SendMessage( GetDlgItem(hDlg,IDC_AIP), BM_SETCHECK, (bAIP) ? BST_CHECKED : BST_UNCHECKED, 0);
+ SendMessage( GetDlgItem(hDlg,IDC_NOL), BM_SETCHECK, (bNOL) ? BST_CHECKED : BST_UNCHECKED, 0);
+ SendMessage( GetDlgItem(hDlg,IDC_AAK), BM_SETCHECK, (bAAK) ? BST_CHECKED : BST_UNCHECKED, 0);
+ SendMessage( GetDlgItem(hDlg,IDC_MCM), BM_SETCHECK, (bMCM) ? BST_CHECKED : BST_UNCHECKED, 0);
// Select {OFF,PGP,GPG}
- SendMessage(GetDlgItem(hDlg,IDC_PGP),BM_SETCHECK,bPGP?BST_CHECKED:BST_UNCHECKED,0L);
- SendMessage(GetDlgItem(hDlg,IDC_GPG),BM_SETCHECK,bGPG?BST_CHECKED:BST_UNCHECKED,0L);
+ SendMessage( GetDlgItem(hDlg,IDC_PGP), BM_SETCHECK, bPGP ? BST_CHECKED : BST_UNCHECKED, 0);
+ SendMessage( GetDlgItem(hDlg,IDC_GPG), BM_SETCHECK, bGPG ? BST_CHECKED : BST_UNCHECKED, 0);
// rebuild list of contacts
HWND hLV = GetDlgItem(hDlg,IDC_STD_USERLIST);
@@ -1139,9 +1139,8 @@ void RefreshGeneralDlg(HWND hDlg, BOOL iInit) { char tmp[NAMSIZE];
while (hContact) {
-
pUinKey ptr = getUinKey(hContact);
- if ( ptr && isSecureProtocol(hContact) /*&& !getMetaContact(hContact)*/ && !isChatRoom(hContact)) {
+ if ( ptr && isSecureProtocol(hContact) && !isChatRoom(hContact)) {
if ( iInit ) {
ptr->tmode = ptr->mode;
@@ -1286,7 +1285,7 @@ void RefreshGPGDlg(HWND hDlg, BOOL iInit) { SetDlgItemText(hDlg, IDC_GPGHOME_EDIT, path);
mir_free(path);
}
- BOOL bGPGLogFlag = DBGetContactSettingByte(0, szModuleName, "gpgLogFlag",0);
+ BOOL bGPGLogFlag = db_get_b(0, szModuleName, "gpgLogFlag",0);
SendMessage(GetDlgItem(hDlg,IDC_LOGGINGON_CBOX),BM_SETCHECK,(bGPGLogFlag)?BST_CHECKED:BST_UNCHECKED,0L);
path = myDBGetString(0,szModuleName,"gpgLog");
if(path) {
@@ -1294,7 +1293,7 @@ void RefreshGPGDlg(HWND hDlg, BOOL iInit) { mir_free(path);
}
SendMessage(GetDlgItem(hDlg,IDC_SAVEPASS_CBOX),BM_SETCHECK,(bSavePass)?BST_CHECKED:BST_UNCHECKED,0L);
- BOOL bGPGTmpFlag = DBGetContactSettingByte(0, szModuleName, "gpgTmpFlag",0);
+ BOOL bGPGTmpFlag = db_get_b(0, szModuleName, "gpgTmpFlag",0);
SendMessage(GetDlgItem(hDlg,IDC_TMPPATHON_CBOX),BM_SETCHECK,(bGPGTmpFlag)?BST_CHECKED:BST_UNCHECKED,0L);
path = myDBGetString(0,szModuleName,"gpgTmp");
if(path) {
@@ -1453,12 +1452,12 @@ void ApplyGeneralSettings(HWND hDlg) { i = SendMessage(GetDlgItem(hDlg, IDC_PGP),BM_GETCHECK,0L,0L)==BST_CHECKED;
if(i!=bPGP) {
bPGP = i; tmp++;
- DBWriteContactSettingByte(0, szModuleName, "pgp", bPGP);
+ db_set_b(0, szModuleName, "pgp", bPGP);
}
i = SendMessage(GetDlgItem(hDlg, IDC_GPG),BM_GETCHECK,0L,0L)==BST_CHECKED;
if(i!=bGPG) {
bGPG = i; tmp++;
- DBWriteContactSettingByte(0, szModuleName, "gpg", bGPG);
+ db_set_b(0, szModuleName, "gpg", bGPG);
}
if(tmp) msgbox1(hDlg, sim224, szModuleName, MB_OK|MB_ICONINFORMATION);
}
@@ -1470,12 +1469,12 @@ void ApplyGeneralSettings(HWND hDlg) { if ( !ptr ) continue;
if ( ptr->mode!=ptr->tmode ) {
ptr->mode = ptr->tmode;
- DBWriteContactSettingByte(ptr->hContact, szModuleName, "mode", ptr->mode);
+ db_set_b(ptr->hContact, szModuleName, "mode", ptr->mode);
}
if ( ptr->status!=ptr->tstatus ) {
ptr->status = ptr->tstatus;
if(ptr->status==STATUS_ENABLED) DBDeleteContactSetting(ptr->hContact, szModuleName, "StatusID");
- else DBWriteContactSettingByte(ptr->hContact, szModuleName, "StatusID", ptr->status);
+ else db_set_b(ptr->hContact, szModuleName, "StatusID", ptr->status);
}
if ( ptr->mode==MODE_NATIVE ) {
if ( getListViewPSK(hLV,i)) {
@@ -1523,7 +1522,7 @@ void ApplyProtoSettings(HWND hDlg) { void ApplyPGPSettings(HWND hDlg) {
bUseKeyrings = !(SendMessage(GetDlgItem(hDlg, IDC_NO_KEYRINGS),BM_GETCHECK,0L,0L)==BST_CHECKED);
- DBWriteContactSettingByte(0,szModuleName,"ukr",bUseKeyrings);
+ db_set_b(0,szModuleName,"ukr",bUseKeyrings);
char *priv = myDBGetString(0,szModuleName,"tpgpPrivKey");
if(priv) {
@@ -1546,17 +1545,17 @@ void ApplyGPGSettings(HWND hDlg) { DBWriteContactSettingString(0,szModuleName,"gpgHome",tmp);
bSavePass = (SendMessage(GetDlgItem(hDlg, IDC_SAVEPASS_CBOX),BM_GETCHECK,0L,0L)==BST_CHECKED);
- DBWriteContactSettingByte(0,szModuleName,"gpgSaveFlag",bSavePass);
+ db_set_b(0,szModuleName,"gpgSaveFlag",bSavePass);
BOOL bgpgLogFlag = (SendMessage(GetDlgItem(hDlg, IDC_LOGGINGON_CBOX),BM_GETCHECK,0L,0L)==BST_CHECKED);
- DBWriteContactSettingByte(0,szModuleName,"gpgLogFlag",bgpgLogFlag);
+ db_set_b(0,szModuleName,"gpgLogFlag",bgpgLogFlag);
GetDlgItemText(hDlg, IDC_GPGLOGFILE_EDIT, tmp, sizeof(tmp));
DBWriteContactSettingString(0,szModuleName,"gpgLog",tmp);
if(bgpgLogFlag) gpg_set_log(tmp);
else gpg_set_log(0);
BOOL bgpgTmpFlag = (SendMessage(GetDlgItem(hDlg, IDC_TMPPATHON_CBOX),BM_GETCHECK,0L,0L)==BST_CHECKED);
- DBWriteContactSettingByte(0,szModuleName,"gpgTmpFlag",bgpgTmpFlag);
+ db_set_b(0,szModuleName,"gpgTmpFlag",bgpgTmpFlag);
GetDlgItemText(hDlg, IDC_GPGTMPPATH_EDIT, tmp, sizeof(tmp));
DBWriteContactSettingString(0,szModuleName,"gpgTmp",tmp);
if(bgpgTmpFlag) gpg_set_tmp(tmp);
@@ -1569,7 +1568,7 @@ void ApplyGPGSettings(HWND hDlg) { if ( !ptr ) continue;
if ( ptr->gpgMode != ptr->tgpgMode ) {
ptr->gpgMode = ptr->tgpgMode;
- if ( ptr->gpgMode ) DBWriteContactSettingByte(ptr->hContact,szModuleName,"gpgANSI",1);
+ if ( ptr->gpgMode ) db_set_b(ptr->hContact,szModuleName,"gpgANSI",1);
else DBDeleteContactSetting(ptr->hContact,szModuleName,"gpgANSI");
}
@@ -1761,14 +1760,14 @@ void ListView_Sort(HWND hLV, LPARAM lParamSort) { // restore sort column
sprintf(t,"os%02x",(UINT)lParamSort&0xF0);
if ((lParamSort&0x0F)==0) {
- lParamSort=(int)DBGetContactSettingByte(0, szModuleName, t, lParamSort+1);
+ lParamSort=(int)db_get_b(0, szModuleName, t, lParamSort+1);
}
- DBWriteContactSettingByte(0, szModuleName, t, (BYTE)lParamSort);
+ db_set_b(0, szModuleName, t, (BYTE)lParamSort);
// restore sort order
sprintf(t,"os%02x",(UINT)lParamSort);
- int m=DBGetContactSettingByte(0, szModuleName, t, 0);
- if(bChangeSortOrder){ m=!m; DBWriteContactSettingByte(0, szModuleName, t, m); }
+ int m=db_get_b(0, szModuleName, t, 0);
+ if(bChangeSortOrder){ m=!m; db_set_b(0, szModuleName, t, m); }
ListView_SortItems(hLV,&CompareFunc,lParamSort|(m<<8));
}
diff --git a/plugins/SecureIM/src/popupOptions.cpp b/plugins/SecureIM/src/popupOptions.cpp index 6e08cd81fc..eb588dde70 100644 --- a/plugins/SecureIM/src/popupOptions.cpp +++ b/plugins/SecureIM/src/popupOptions.cpp @@ -52,32 +52,32 @@ INT_PTR CALLBACK PopOptionsDlgProc(HWND hDlg, UINT wMsg, WPARAM wParam, LPARAM l break;
case IDC_EC: {
//set ec checkbox value
- DBWriteContactSettingByte(0, szModuleName, "ec", (BYTE)(SendMessage(hec,BM_GETCHECK,0L,0L)==BST_CHECKED));
+ db_set_b(0, szModuleName, "ec", (BYTE)(SendMessage(hec,BM_GETCHECK,0L,0L)==BST_CHECKED));
}
break;
case IDC_DC: {
//set dc checkbox value
- DBWriteContactSettingByte(0, szModuleName, "dc", (BYTE)(SendMessage(hdc,BM_GETCHECK,0L,0L)==BST_CHECKED));
+ db_set_b(0, szModuleName, "dc", (BYTE)(SendMessage(hdc,BM_GETCHECK,0L,0L)==BST_CHECKED));
}
break;
case IDC_SS: {
//set ss checkbox value
- DBWriteContactSettingByte(0, szModuleName, "ss", (BYTE)(SendMessage(hss,BM_GETCHECK,0L,0L)==BST_CHECKED));
+ db_set_b(0, szModuleName, "ss", (BYTE)(SendMessage(hss,BM_GETCHECK,0L,0L)==BST_CHECKED));
}
break;
case IDC_SR: {
//set sr checkbox value
- DBWriteContactSettingByte(0, szModuleName, "sr", (BYTE)(SendMessage(hsr,BM_GETCHECK,0L,0L)==BST_CHECKED));
+ db_set_b(0, szModuleName, "sr", (BYTE)(SendMessage(hsr,BM_GETCHECK,0L,0L)==BST_CHECKED));
}
break;
case IDC_KS: {
//set indicator checkbox value
- DBWriteContactSettingByte(0, szModuleName, "ks", (BYTE)(SendMessage(hks,BM_GETCHECK,0L,0L)==BST_CHECKED));
+ db_set_b(0, szModuleName, "ks", (BYTE)(SendMessage(hks,BM_GETCHECK,0L,0L)==BST_CHECKED));
}
break;
case IDC_KR: {
//set indicator checkbox value
- DBWriteContactSettingByte(0, szModuleName, "kr", (BYTE)(SendMessage(hkr,BM_GETCHECK,0L,0L)==BST_CHECKED));
+ db_set_b(0, szModuleName, "kr", (BYTE)(SendMessage(hkr,BM_GETCHECK,0L,0L)==BST_CHECKED));
}
break;
case IDC_TIMEKEY: {
diff --git a/plugins/SecureIM/src/svcs_menu.cpp b/plugins/SecureIM/src/svcs_menu.cpp index d2d06c09fc..77a9271994 100644 --- a/plugins/SecureIM/src/svcs_menu.cpp +++ b/plugins/SecureIM/src/svcs_menu.cpp @@ -29,7 +29,7 @@ INT_PTR __cdecl Service_Status(WPARAM wParam, LPARAM lParam) { if(ptr) {
ptr->status=ptr->tstatus=(BYTE)lParam;
if(ptr->status==STATUS_ENABLED) DBDeleteContactSetting(ptr->hContact, szModuleName, "StatusID");
- else DBWriteContactSettingByte(ptr->hContact, szModuleName, "StatusID", ptr->status);
+ else db_set_b(ptr->hContact, szModuleName, "StatusID", ptr->status);
}
break;
}
@@ -89,7 +89,7 @@ INT_PTR __cdecl Service_PGPsetKey(WPARAM wParam, LPARAM lParam) { cws.value.pbVal = (LPBYTE)KeyID;
cws.value.cpbVal = pgp_size_keyid();
CallService(MS_DB_CONTACT_WRITESETTING,wParam,(LPARAM)&cws);
- DBWriteContactSettingByte((HANDLE)wParam,szModuleName,"pgp_mode",0);
+ db_set_b((HANDLE)wParam,szModuleName,"pgp_mode",0);
DBWriteContactSettingString((HANDLE)wParam,szModuleName,"pgp_abbr",szKeyID);
del = false;
}
@@ -102,7 +102,7 @@ INT_PTR __cdecl Service_PGPsetKey(WPARAM wParam, LPARAM lParam) { if(publ) {
DBDeleteContactSetting((HANDLE)wParam,szModuleName,"pgp");
myDBWriteStringEncode((HANDLE)wParam,szModuleName,"pgp",publ);
- DBWriteContactSettingByte((HANDLE)wParam,szModuleName,"pgp_mode",1);
+ db_set_b((HANDLE)wParam,szModuleName,"pgp_mode",1);
DBWriteContactSettingString((HANDLE)wParam,szModuleName,"pgp_abbr","(binary)");
mir_free(publ);
del = false;
@@ -181,7 +181,7 @@ INT_PTR __cdecl Service_Mode(WPARAM wParam, LPARAM lParam) { ptr->keyLoaded = 0;
}
ptr->mode=(BYTE)lParam;
- DBWriteContactSettingByte((HANDLE)wParam, szModuleName, "mode", (BYTE)lParam);
+ db_set_b((HANDLE)wParam, szModuleName, "mode", (BYTE)lParam);
}
ShowStatusIcon((HANDLE)wParam);
break;
diff --git a/plugins/SecureIM/src/svcs_proto.cpp b/plugins/SecureIM/src/svcs_proto.cpp index ef8d6c850c..8d2aade148 100644 --- a/plugins/SecureIM/src/svcs_proto.cpp +++ b/plugins/SecureIM/src/svcs_proto.cpp @@ -188,7 +188,7 @@ INT_PTR __cdecl onRecvMsg(WPARAM wParam, LPARAM lParam) { #endif
szEncMsg = ppre->szMessage;
if ( !ptr->cntx ) {
- ptr->cntx = cpp_create_context(((bGPGloaded && bGPGkeyrings)?CPP_MODE_GPG:CPP_MODE_PGP) | ((DBGetContactSettingByte(pccsd->hContact,szModuleName,"gpgANSI",0))?CPP_MODE_GPG_ANSI:0));
+ ptr->cntx = cpp_create_context(((bGPGloaded && bGPGkeyrings)?CPP_MODE_GPG:CPP_MODE_PGP) | ((db_get_b(pccsd->hContact,szModuleName,"gpgANSI",0))?CPP_MODE_GPG_ANSI:0));
ptr->keyLoaded = 0;
}
@@ -245,7 +245,7 @@ INT_PTR __cdecl onRecvMsg(WPARAM wParam, LPARAM lParam) { if ( ptr->mode==MODE_NATIVE ) {
ptr->mode = MODE_RSAAES;
deleteRSAcntx(ptr);
- DBWriteContactSettingByte(ptr->hContact, szModuleName, "mode", ptr->mode);
+ db_set_b(ptr->hContact, szModuleName, "mode", ptr->mode);
}
createRSAcntx(ptr);
loadRSAkey(ptr);
@@ -361,7 +361,7 @@ INT_PTR __cdecl onRecvMsg(WPARAM wParam, LPARAM lParam) { Sent_NetLog("onRecvMsg: Native SiG_DISA message");
#endif
// ptr->status=ptr->tstatus=STATUS_DISABLED;
-// DBWriteContactSettingByte(ptr->hContact, szModuleName, "StatusID", ptr->status);
+// db_set_b(ptr->hContact, szModuleName, "StatusID", ptr->status);
}
case SiG_DEIN: { // deinit message
// other user has disabled SecureIM with you
@@ -382,7 +382,7 @@ INT_PTR __cdecl onRecvMsg(WPARAM wParam, LPARAM lParam) { cpp_delete_context(ptr->cntx);
ptr->cntx = 0;
ptr->keyLoaded = 0;
- DBWriteContactSettingByte(ptr->hContact, szModuleName, "mode", ptr->mode);
+ db_set_b(ptr->hContact, szModuleName, "mode", ptr->mode);
}
switch(ssig) {
case SiG_KEYR: { // key3 message
@@ -419,7 +419,7 @@ INT_PTR __cdecl onRecvMsg(WPARAM wParam, LPARAM lParam) { if ( ptr->features & CPP_FEATURES_RSA ) {
// switch to RSAAES mode
ptr->mode = MODE_RSAAES;
- DBWriteContactSettingByte(ptr->hContact, szModuleName, "mode", ptr->mode);
+ db_set_b(ptr->hContact, szModuleName, "mode", ptr->mode);
resetRSAcntx(ptr);
loadRSAkey(ptr);
@@ -627,7 +627,7 @@ INT_PTR __cdecl onSendMsg(WPARAM wParam, LPARAM lParam) { }
*/
if ( !ptr->cntx ) {
- ptr->cntx = cpp_create_context((isContactGPG(ptr->hContact)?CPP_MODE_GPG:CPP_MODE_PGP) | ((DBGetContactSettingByte(ptr->hContact,szModuleName,"gpgANSI",0))?CPP_MODE_GPG_ANSI:0));
+ ptr->cntx = cpp_create_context((isContactGPG(ptr->hContact)?CPP_MODE_GPG:CPP_MODE_PGP) | ((db_get_b(ptr->hContact,szModuleName,"gpgANSI",0))?CPP_MODE_GPG_ANSI:0));
ptr->keyLoaded = 0;
}
if ( !ptr->keyLoaded && bPGPloaded ) ptr->keyLoaded = LoadKeyPGP(ptr);
@@ -885,7 +885,7 @@ INT_PTR __cdecl onSendMsg(WPARAM wParam, LPARAM lParam) { #if defined(_DEBUG) || defined(NETLIB_LOG)
Sent_NetLog("onSendMsg: cryptokey exist");
#endif
-/* if ( !hMetaContact && isProtoMetaContacts(pccsd->hContact) && (DBGetContactSettingByte(NULL, "MetaContacts", "SubcontactHistory", 1) == 1)) {
+/* if ( !hMetaContact && isProtoMetaContacts(pccsd->hContact) && (db_get_b(NULL, "MetaContacts", "SubcontactHistory", 1) == 1)) {
// add sent event to subcontact
DBEVENTINFO dbei; HANDLE hC = getMostOnline(pccsd->hContact);
ZeroMemory(&dbei, sizeof(dbei));
diff --git a/plugins/SecureIM/src/svcs_rsa.cpp b/plugins/SecureIM/src/svcs_rsa.cpp index bfb954b2c5..3b75840b74 100644 --- a/plugins/SecureIM/src/svcs_rsa.cpp +++ b/plugins/SecureIM/src/svcs_rsa.cpp @@ -112,7 +112,7 @@ void __cdecl rsa_notify(HANDLE context, int state) { case -8: { // сессия разорвана по причине "disabled"
msg=sim508;
// ptr->status=ptr->tstatus=STATUS_DISABLED;
-// DBWriteContactSettingByte(ptr->hContact, szModuleName, "StatusID", ptr->status);
+// db_set_b(ptr->hContact, szModuleName, "StatusID", ptr->status);
} break;
case -0x10: // сессия разорвана по ошибке
case -0x21:
|