From 72f3ccc35b220489bf52abd2abe1d901c87acb2c Mon Sep 17 00:00:00 2001 From: Gluzskiy Alexandr Date: Fri, 13 Aug 2010 02:27:42 +0300 Subject: modified: main.cpp modified: messages.cpp modified: new_gpg.rc modified: resource.h modified: utilities.cpp --- messages.cpp | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'messages.cpp') 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<