diff options
author | Alexander Gluzsky <sss123next@list.ru> | 2016-05-16 16:10:20 +0000 |
---|---|---|
committer | Alexander Gluzsky <sss123next@list.ru> | 2016-05-16 16:10:20 +0000 |
commit | 9d076ee1769157730f26d93bfda1489791dd47c7 (patch) | |
tree | a5e471851a4b6cfe2ba21ceafd2254320f925e26 /plugins/New_GPG/src | |
parent | 4bbad2f0985a74f86ecc27d7e95e2ecfcd2d3665 (diff) |
plugins:
new_gpg:
added another LANG* environment variable (required for gpg2)
disabled return code checking (sometimes return error while operation finished succesfully), please do not touch and not remove commented out code.
git-svn-id: http://svn.miranda-ng.org/main/trunk@16835 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/New_GPG/src')
-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); |