summaryrefslogtreecommitdiff
path: root/messages.cpp
diff options
context:
space:
mode:
authorGluzskiy Alexandr <sss123next@list.ru>2010-08-13 02:27:42 +0300
committerGluzskiy Alexandr <sss123next@list.ru>2010-08-13 02:27:42 +0300
commit72f3ccc35b220489bf52abd2abe1d901c87acb2c (patch)
tree2b1f3b97e46dbf4d19266f333042eef31a064404 /messages.cpp
parentbbc0a43dd52f35129599fa9774f52fc7ad8d089e (diff)
modified: main.cpp
modified: messages.cpp modified: new_gpg.rc modified: resource.h modified: utilities.cpp
Diffstat (limited to 'messages.cpp')
-rw-r--r--messages.cpp19
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);