diff options
Diffstat (limited to 'messages.cpp')
-rw-r--r-- | messages.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
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;
|