diff options
Diffstat (limited to 'messages.cpp')
-rw-r--r-- | messages.cpp | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/messages.cpp b/messages.cpp index 792e3fa..db6fdad 100644 --- a/messages.cpp +++ b/messages.cpp @@ -102,7 +102,7 @@ int RecvMsgSvc(WPARAM w, LPARAM l) cmd += _T("\\decrypted_data\"");
cmd += _T(" -d -a \"");
cmd += path;
- cmd += _T("\"");
+ cmd += _T("\"");
pxExecute(&cmd, "", &out, &code);
DeleteFile(path.c_str());
str.clear();
@@ -115,7 +115,11 @@ int RecvMsgSvc(WPARAM w, LPARAM l) {
char tmp[256];
f.getline(tmp, 256);
- TCHAR *tmp2 = mir_a2t(tmp);
+ TCHAR *tmp2;
+// if(unicode)
+ tmp2 = mir_utf8decodeW(tmp);
+// else
+// tmp2 = mir_a2t(tmp);
str.append(tmp2).append(_T("\n"));
mir_free(tmp);
}
@@ -123,12 +127,11 @@ int RecvMsgSvc(WPARAM w, LPARAM l) DeleteFile(path.c_str());
if(!str.length())
{
+ mir_free((void**)pre->szMessage);
pre->szMessage = "Failed to decrypt GPG encrypted message";
return CallService(MS_PROTO_CHAINRECV, w, (LPARAM)ccs);
}
- }
- {
- if(str.length() > 0)
+ else
{
mir_free((void**)pre->szMessage);
char *utf = mir_utf8encodeW(str.c_str());
@@ -185,7 +188,11 @@ int SendMsgSvc(WPARAM w, LPARAM l) path.append(_T("\\exported_data"));
cmd += _T("\"");
{
- char *tmp = mir_t2a(str.c_str());
+ char *tmp;
+// if(unicode)
+ tmp = mir_utf8encodeW(str.c_str());
+// else
+// tmp = mir_t2a(str.c_str());
wfstream f(path.c_str(), std::ios::out);
f<<tmp;
mir_free(tmp);
|