diff options
Diffstat (limited to 'messages.cpp')
-rw-r--r-- | messages.cpp | 25 |
1 files changed, 22 insertions, 3 deletions
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);
|