diff options
-rwxr-xr-x | plugins/New_GPG/src/gpg_wrapper.cpp | 1 | ||||
-rwxr-xr-x | plugins/New_GPG/src/messages.cpp | 26 |
2 files changed, 14 insertions, 13 deletions
diff --git a/plugins/New_GPG/src/gpg_wrapper.cpp b/plugins/New_GPG/src/gpg_wrapper.cpp index 626be8d6f8..c979149e2f 100755 --- a/plugins/New_GPG/src/gpg_wrapper.cpp +++ b/plugins/New_GPG/src/gpg_wrapper.cpp @@ -46,6 +46,7 @@ pxResult pxExecute(std::vector<std::wstring> &aargv, string *aoutput, LPDWORD ae std::vector<std::wstring> env; env.push_back(L"LANGUAGE=en@quot"); env.push_back(L"LC_ALL=English"); + env.push_back(L"LANG=C"); argv.push_back(bin_path); TCHAR *home_dir = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", _T("")); if(mir_tstrlen(home_dir)) //this check are required for first run gpg binary validation diff --git a/plugins/New_GPG/src/messages.cpp b/plugins/New_GPG/src/messages.cpp index eb54f53fb2..61db0a7d0e 100755 --- a/plugins/New_GPG/src/messages.cpp +++ b/plugins/New_GPG/src/messages.cpp @@ -186,7 +186,7 @@ void RecvMsgSvc_func(MCONTACT hContact, std::wstring str, char *msg, DWORD, DWOR HistoryLog(hContact, db_event(msg, timestamp, 0, dbflags)); return; } - if (result == pxSuccessExitCodeInvalid) +/* if (result == pxSuccessExitCodeInvalid) //sometime we have invalid return code after succesful decryption, this should be non-fatal at least { if(!bDebugLog) { @@ -197,7 +197,7 @@ void RecvMsgSvc_func(MCONTACT hContact, std::wstring str, char *msg, DWORD, DWOR HistoryLog(hContact, db_event(msg, timestamp, 0, dbflags)); HistoryLog(hContact, db_event(Translate("failed to decrypt message, GPG returned error, turn on debug log for more details"), timestamp, 0, 0)); return; - } + } */ //TODO: check gpg output for errors _terminate = false; @@ -480,11 +480,11 @@ INT_PTR RecvMsgSvc(WPARAM w, LPARAM l) } if (result == pxNotFound) return 1; - if (result == pxSuccessExitCodeInvalid) +/* if (result == pxSuccessExitCodeInvalid) //sometime we have invalid return code after succesful decryption, this should be non-fatal at least { HistoryLog(ccs->hContact, db_event(Translate("failed to decrypt message, GPG returned error, turn on debug log for more details"))); return 1; - } + } */ { char *tmp = NULL; s1 = output.find("gpg: key ") + mir_strlen("gpg: key "); @@ -768,16 +768,16 @@ void SendMsgSvc_func(MCONTACT hContact, char *msg, DWORD flags) } else return; } - if (result == pxSuccessExitCodeInvalid) { +// if (result == pxSuccessExitCodeInvalid) { //sometims gpg return error after succesful operation, this should be non-fatal at least //mir_free(msg); - HistoryLog(hContact, db_event(Translate("failed to encrypt message, GPG returned error, turn on debug log for more details"), 0, 0, DBEF_SENT)); - if(!bDebugLog) - { - boost::system::error_code e; - boost::filesystem::remove(path, e); - } - return; - } +// HistoryLog(hContact, db_event(Translate("failed to encrypt message, GPG returned error, turn on debug log for more details"), 0, 0, DBEF_SENT)); +// if(!bDebugLog) +// { +// boost::system::error_code e; +// boost::filesystem::remove(path, e); +// } +// return; +// } if (out.find("usage: ") != string::npos) { MessageBox(0, TranslateT("Something is wrong, GPG does not understand us, aborting encryption."), TranslateT("Warning"), MB_OK); //mir_free(msg); |