From 6625610170411e9a5fcd43dfd66436fa12fd43e7 Mon Sep 17 00:00:00 2001 From: Gluzskiy Alexandr Date: Mon, 16 Aug 2010 20:11:51 +0300 Subject: modified: constants.h modified: gpg_wrapper.cpp modified: init.cpp modified: main.cpp modified: messages.cpp modified: options.cpp modified: utilities.cpp --- messages.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'messages.cpp') diff --git a/messages.cpp b/messages.cpp index 1fca963..2c095ed 100644 --- a/messages.cpp +++ b/messages.cpp @@ -43,7 +43,7 @@ int RecvMsgSvc(WPARAM w, LPARAM l) s1 = str.find(_T("-----BEGIN PGP PUBLIC KEY BLOCK-----")); if((s2 != wstring::npos) && (s1 != wstring::npos)) { //this is public key - if(!DBGetContactSettingByte(ccs->hContact, szModuleName, "GPGEncryption", 0)) + if(!DBGetContactSettingByte(ccs->hContact, szGPGModuleName, "GPGEncryption", 0)) ;// void ShowNewKeyDialog(); s1 = 0; @@ -63,10 +63,10 @@ int RecvMsgSvc(WPARAM w, LPARAM l) s2 = str.find(_T("-----END PGP MESSAGE-----")); if((s2 != wstring::npos) && (s1 != wstring::npos)) { //this is generic encrypted data block - if(!DBGetContactSettingByte(ccs->hContact, szModuleName, "GPGEncryption", 0)) + if(!DBGetContactSettingByte(ccs->hContact, szGPGModuleName, "GPGEncryption", 0)) { if(MessageBox(0, _T("We received encrypted message from contact with encryption turned off.\nDo you want turn on encryption for this contact ?"), _T("Warning"), MB_YESNO) == IDYES) - DBWriteContactSettingByte(ccs->hContact, szModuleName, "GPGEncryption", 1); + DBWriteContactSettingByte(ccs->hContact, szGPGModuleName, "GPGEncryption", 1); else if(MessageBox(0, _T("Do you want try to decrypt encrypted message ?"), _T("Warning"), MB_YESNO) == IDNO) return CallService(MS_PROTO_CHAINRECV, w, l); } @@ -77,7 +77,7 @@ int RecvMsgSvc(WPARAM w, LPARAM l) } s2 += _tcslen(_T("-----END PGP MESSAGE-----")); char *tmp = mir_t2a(str.substr(s1,s2-s1).c_str()); - TCHAR *tmp2 = UniGetContactSettingUtf(NULL, szModuleName, "szHomePath", _T("")); + TCHAR *tmp2 = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", _T("")); wstring path = tmp2; path.append(_T("\\encrypted_data.asc")); wfstream f(path.c_str(), std::ios::out); @@ -89,7 +89,7 @@ int RecvMsgSvc(WPARAM w, LPARAM l) DWORD code; wstring cmd; { - TCHAR *tmp = UniGetContactSettingUtf(NULL, szModuleName, "szKeyPassword", _T("")); + TCHAR *tmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szKeyPassword", _T("")); if(_tcslen(tmp) > 0) { cmd += _T("--passphrase \""); @@ -178,7 +178,7 @@ int SendMsgSvc(WPARAM w, LPARAM l) CCSDATA *ccs = (CCSDATA*)l; if (!ccs) return CallService(MS_PROTO_CHAINSEND, w, l); - if(!DBGetContactSettingByte(ccs->hContact, szModuleName, "GPGEncryption", 0)) + if(!DBGetContactSettingByte(ccs->hContact, szGPGModuleName, "GPGEncryption", 0)) return CallService(MS_PROTO_CHAINSEND, w, l); char *msg = (char*)(ccs->lParam); @@ -196,14 +196,14 @@ int SendMsgSvc(WPARAM w, LPARAM l) DWORD code; wstring cmd; wstring path; - char *tmp = UniGetContactSettingUtf(ccs->hContact, szModuleName, "KeyID", ""); + char *tmp = UniGetContactSettingUtf(ccs->hContact, szGPGModuleName, "KeyID", ""); if(strlen(tmp) < 2) { mir_free(tmp); return CallService(MS_PROTO_CHAINSEND, w, l); } // cmd += _T("--comment \"\" --no-version "); - if(DBGetContactSettingByte(ccs->hContact, szModuleName, "bAlwaysTrust", 0)) + if(DBGetContactSettingByte(ccs->hContact, szGPGModuleName, "bAlwaysTrust", 0)) cmd += _T("--trust-model always "); cmd += _T("--batch --yes -e -a -r "); TCHAR *tmp2 = mir_a2t(tmp); @@ -211,7 +211,7 @@ int SendMsgSvc(WPARAM w, LPARAM l) cmd += tmp2; mir_free(tmp2); cmd += _T(" \""); - tmp2 = UniGetContactSettingUtf(NULL, szModuleName, "szHomePath", _T("")); + tmp2 = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", _T("")); path.append(tmp2); cmd += tmp2; mir_free(tmp2); @@ -241,7 +241,7 @@ int SendMsgSvc(WPARAM w, LPARAM l) out.clear(); if(MessageBox(0, _T("We trying to encrypt with untrusted key, do you want to trust this key permanently ?"), _T("Warning"), MB_YESNO) == IDYES) { - DBWriteContactSettingByte(ccs->hContact, szModuleName, "bAlwaysTrust", 1); + DBWriteContactSettingByte(ccs->hContact, szGPGModuleName, "bAlwaysTrust", 1); cmd.insert(0, _T("--trust-model always ")); if(pxExecute(&cmd, "", &out, &code) == pxNotFound) { @@ -274,7 +274,7 @@ int SendMsgSvc(WPARAM w, LPARAM l) char *utf = mir_u2a(str.c_str()); ccs->lParam = (LPARAM)utf; if(bAppendTags) - DBWriteContactSettingByte(ccs->hContact, szModuleName, "MsgsForTagging", DBGetContactSettingByte(ccs->hContact, szModuleName, "MsgsForTagging", 0) + 1); + DBWriteContactSettingByte(ccs->hContact, szGPGModuleName, "MsgsForTagging", DBGetContactSettingByte(ccs->hContact, szGPGModuleName, "MsgsForTagging", 0) + 1); } } ccs->wParam&=~PREF_UNICODE; @@ -284,14 +284,14 @@ int SendMsgSvc(WPARAM w, LPARAM l) int HookSendMsg(WPARAM w, LPARAM l) { HANDLE hContact = (HANDLE)w; - if(!DBGetContactSettingByte(hContact, szModuleName, "GPGEncryption", 0)) + if(!DBGetContactSettingByte(hContact, szGPGModuleName, "GPGEncryption", 0)) return 0; if(bAppendTags) { if(!l) return 0; - BYTE Msgs = DBGetContactSettingByte(hContact, szModuleName, "MsgsForTagging", 0); + BYTE Msgs = DBGetContactSettingByte(hContact, szGPGModuleName, "MsgsForTagging", 0); if(!Msgs) return 0; DBEVENTINFO * dbei = (DBEVENTINFO*)l; @@ -307,7 +307,7 @@ int HookSendMsg(WPARAM w, LPARAM l) mir_free(dbei->pBlob); dbei->pBlob = (PBYTE)msg2; dbei->cbBlob = strlen(msg2)+1; - DBWriteContactSettingByte(hContact, szModuleName, "MsgsForTagging", Msgs - 1); + DBWriteContactSettingByte(hContact, szGPGModuleName, "MsgsForTagging", Msgs - 1); } } return 0; -- cgit v1.2.3