From bbc0a43dd52f35129599fa9774f52fc7ad8d089e Mon Sep 17 00:00:00 2001 From: Gluzskiy Alexandr Date: Fri, 13 Aug 2010 00:41:24 +0300 Subject: modified: main.cpp modified: messages.cpp modified: new_gpg.icproj modified: new_gpg.vcproj --- main.cpp | 2 +- messages.cpp | 10 ++++++++++ new_gpg.icproj | 6 ++++-- new_gpg.vcproj | 4 ++-- 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/main.cpp b/main.cpp index 22c1fd7..1ab11aa 100644 --- a/main.cpp +++ b/main.cpp @@ -155,6 +155,7 @@ static BOOL CALLBACK DlgProcFirstRun(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM pxExecute(&cmd, "", &out, &code); DBWriteContactSettingString(NULL, szModuleName, "GPGPubKey", out.c_str()); } + DBWriteContactSettingByte(NULL, szModuleName, "FirstRun", 0); DestroyWindow(hwndDlg); break; } @@ -209,5 +210,4 @@ void FirstRun() if(!DBGetContactSettingByte(NULL, szModuleName, "FirstRun", 1)) return; ShowFirstRunDialog(); - DBWriteContactSettingByte(NULL, szModuleName, "FirstRun", 0); } diff --git a/messages.cpp b/messages.cpp index 8bc2914..792e3fa 100644 --- a/messages.cpp +++ b/messages.cpp @@ -121,6 +121,11 @@ int RecvMsgSvc(WPARAM w, LPARAM l) } f.close(); DeleteFile(path.c_str()); + if(!str.length()) + { + pre->szMessage = "Failed to decrypt GPG encrypted message"; + return CallService(MS_PROTO_CHAINRECV, w, (LPARAM)ccs); + } } { if(str.length() > 0) @@ -200,6 +205,11 @@ int SendMsgSvc(WPARAM w, LPARAM l) } f.close(); DeleteFile(path.c_str()); + if(!str.length()) + { + ccs->lParam = (LPARAM)"Failed to encrypt message with GPG"; + return CallService(MS_PROTO_CHAINRECV, w, (LPARAM)ccs); + } mir_free((void**)ccs->lParam); char *utf = mir_utf8encodeW(str.c_str()); ccs->lParam = (LPARAM)utf; diff --git a/new_gpg.icproj b/new_gpg.icproj index 1af9561..a120b49 100644 --- a/new_gpg.icproj +++ b/new_gpg.icproj @@ -17,10 +17,12 @@ Name="Release Unicode (static)|Win32"> + EnableEnhancedInstructionSet="1000" + FloatingPointModel="1000" + UseProcessorExtensions="4"/> diff --git a/new_gpg.vcproj b/new_gpg.vcproj index 5964dba..3a1459a 100644 --- a/new_gpg.vcproj +++ b/new_gpg.vcproj @@ -245,9 +245,9 @@ />