From 6b1b91acffcc90db9f6d8e0c466d44e2a6819dc3 Mon Sep 17 00:00:00 2001 From: Gluzskiy Alexandr Date: Thu, 9 Sep 2010 22:56:44 +0300 Subject: modified: init.cpp modified: messages.cpp modified: new_gpg.rc modified: options.cpp modified: utilities.cpp --- messages.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'messages.cpp') diff --git a/messages.cpp b/messages.cpp index 18db824..9dfe9d7 100644 --- a/messages.cpp +++ b/messages.cpp @@ -316,14 +316,15 @@ int RecvMsgSvc(WPARAM w, LPARAM l) delete [] tmp; str.append(tmp2); mir_free(tmp2); + f.close(); + DeleteFile(path.c_str()); } - f.close(); - DeleteFile(path.c_str()); if(str.empty()) { string str = pre->szMessage; mir_free((void**)pre->szMessage); str.insert(0, "Failed to decrypt GPG encrypted message:\n"); + debuglog<<"info: Failed to decrypt GPG encrypted message.\n"; pre->szMessage = mir_strdup(str.c_str()); return CallService(MS_PROTO_CHAINRECV, w, (LPARAM)ccs); } @@ -473,12 +474,13 @@ int SendMsgSvc(WPARAM w, LPARAM l) tmp[size]= '\0'; str.append(tmp); delete [] tmp; + f.close(); + DeleteFile(path.c_str()); } - f.close(); - DeleteFile(path.c_str()); - if(!str.length()) + if(str.empty()) { HistoryLog(hContact, "Failed to encrypt message with GPG", EVENTTYPE_MESSAGE, DBEF_SENT); + debuglog<<"info: Failed to encrypt message with GPG"; return CallService(MS_PROTO_CHAINRECV, w, (LPARAM)ccs); } // mir_free((void**)ccs->lParam); -- cgit v1.2.3