From a5ef2e4a080e26fbb91381edf59da9fc9456f9cb Mon Sep 17 00:00:00 2001 From: Gluzskiy Alexandr Date: Fri, 13 Aug 2010 05:54:52 +0300 Subject: modified: messages.cpp --- messages.cpp | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) (limited to 'messages.cpp') diff --git a/messages.cpp b/messages.cpp index 8617a70..d3456ec 100644 --- a/messages.cpp +++ b/messages.cpp @@ -107,12 +107,29 @@ int RecvMsgSvc(WPARAM w, LPARAM l) cmd += _T(" -d -a \""); cmd += path; cmd += _T("\""); + MessageBox(0, cmd.c_str(), _T("in"), MB_OK); if(pxExecute(&cmd, "", &out, &code) == pxNotFound) { - MessageBox(0, _T("Set path to gpg.exe first!"), _T("Warning"), MB_OK); + MessageBox(0, _T("Set path to gpg.exe first!"), _T("Warning"), MB_OK); + DeleteFile(path.c_str()); return CallService(MS_PROTO_CHAINRECV, w, l); } - DeleteFile(path.c_str()); + MessageBoxA(0, out.c_str(), "out", MB_OK); + { + wstring tmp = tmp2; + tmp += _T("\\decrypted_data"); + if(_waccess(tmp.c_str(), 0) == -1) + { + if(errno == ENOENT) + { + mir_free((void**)pre->szMessage); + pre->szMessage = "Failed to decrypt GPG encrypted message"; + return CallService(MS_PROTO_CHAINRECV, w, (LPARAM)ccs); + } + } + } + + str.clear(); { wstring path = tmp2; @@ -206,11 +223,13 @@ int SendMsgSvc(WPARAM w, LPARAM l) mir_free(tmp); f.close(); } + MessageBox(0, cmd.c_str(), _T("in"), MB_OK); if(pxExecute(&cmd, "", &out, &code) == pxNotFound) { - MessageBox(0, _T("Set path to gpg.exe first!"), _T("Warning"), MB_OK); + MessageBox(0, _T("Set path to gpg.exe first!"), _T("Warning"), MB_OK); return CallService(MS_PROTO_CHAINSEND, w, l); } + MessageBoxA(0, out.c_str(), "out", MB_OK); DeleteFile(path.c_str()); path.append(_T(".asc")); wfstream f(path.c_str(), std::ios::in); -- cgit v1.2.3