summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--messages.cpp29
1 files changed, 21 insertions, 8 deletions
diff --git a/messages.cpp b/messages.cpp
index 7a16dcd..ed3da04 100644
--- a/messages.cpp
+++ b/messages.cpp
@@ -64,21 +64,34 @@ int RecvMsgSvc(WPARAM w, LPARAM l)
cmd += _T("--output \"");
cmd += tmp2;
cmd += _T("\\decrypted_data\"");
- mir_free(tmp2);
cmd += _T(" -d -a \"");
cmd += path;
cmd += _T("\"");
pxExecute(&cmd, "", &out, &code);
DeleteFile(path.c_str());
- cp866_to_cp1251(&out);
+ str.clear();
{
- string::size_type p = out.find(">\"") +2;
- TCHAR *tmp = mir_a2t (out.substr(p).c_str());
- if(_tcslen(tmp) > 0)
+ wstring path = tmp2;
+ mir_free(tmp2);
+ path += _T("\\decrypted_data");
+ fstream f(path.c_str(), std::ios::in);
+ while(!f.eof())
{
- mir_free((void**)ccs->lParam);
- char *utf = mir_utf8encodeW(tmp);
- ccs->lParam = (LPARAM)utf;
+ char tmp[256];
+ f.getline(tmp, 256);
+ TCHAR *tmp2 = mir_a2t(tmp);
+ str.append(tmp2).append(_T("\n"));
+ mir_free(tmp);
+ }
+ f.close();
+ DeleteFile(path.c_str());
+ }
+ {
+ if(str.length() > 0)
+ {
+ mir_free((void**)pre->szMessage);
+ char *utf = mir_utf8encodeW(str.c_str());
+ pre->szMessage = utf;
return CallService(MS_PROTO_CHAINRECV, w, (LPARAM)ccs);
}
}