don't complain about lack of encryption
authorAndrew Engelbrecht <sudoman@ninthfloor.org>
Wed, 12 Aug 2015 16:48:53 +0000 (12:48 -0400)
committerAndrew Engelbrecht <sudoman@ninthfloor.org>
Mon, 7 Dec 2015 18:29:55 +0000 (13:29 -0500)
unless the message has no signature, pub key or encryption.

edward
tests/flatten-1.out
tests/flatten-3.out
tests/flatten-7.out
tests/flatten-8.out
tests/gpg-flatten-3.out
tests/gpg-flatten-5.out
tests/gpg-flatten-6.out

diff --git a/edward b/edward
index aaed2a5c6ab8d99cec0d66aa1f0425d6c343d989..7b633ca94a4c2591e1f991d5996e232f2808b073 100755 (executable)
--- a/edward
+++ b/edward
@@ -215,6 +215,7 @@ class ReplyInfo (object):
     sig_success             = False
     pubkey_success          = False
 
+    decrypt_failure         = False
     sig_failure             = False
     sigkey_missing          = False
     have_reply_key          = False
@@ -727,6 +728,7 @@ def prepare_for_reply_message (piece, replyinfo_obj):
     """
 
     if piece.gpg_data == None or piece.gpg_data.plainobj == None:
+        replyinfo_obj.decrypt_failure = True
         return
 
     replyinfo_obj.decrypt_success = True
@@ -937,7 +939,7 @@ def write_reply (replyinfo_obj):
 
         reply_plain += "\n\n"
 
-    else:
+    elif replyinfo_obj.decrypt_failure == True:
         debug('decrypt failure')
         reply_plain += replyinfo_obj.replies['failed_decrypt']
         reply_plain += "\n\n"
@@ -963,6 +965,12 @@ def write_reply (replyinfo_obj):
         reply_plain += "\n\n"
 
 
+    if (reply_plain == ""):
+        debug('plaintext message')
+        reply_plain += replyinfo_obj.replies['failed_decrypt']
+        reply_plain += "\n\n"
+
+
     reply_plain += replyinfo_obj.replies['signature']
     reply_plain += "\n\n"
 
index 937480191b643b670d4fd94a8249074be7a0f967..75759f9f2c7e0f860cb56eee353b53cf4d6c1df1 100644 (file)
@@ -1,5 +1,3 @@
-I'm sorry, I was not able to decrypt your message. Are you sure you encrypted it with my public key?
-
 Your signature could not be verified.
 
 - Edward, the friendly GnuPG bot
index caecd47ad8e14d07c7cb0e1b72f0349b6a520d3e..a095b1ba59055cba196dfb3a4e5734b23816e785 100644 (file)
@@ -1,5 +1,3 @@
-I'm sorry, I was not able to decrypt your message. Are you sure you encrypted it with my public key?
-
 Your signature could not be verified.
 
 I'm sorry, I was not able to find your public key. Did you remember to attach it?
index 937480191b643b670d4fd94a8249074be7a0f967..75759f9f2c7e0f860cb56eee353b53cf4d6c1df1 100644 (file)
@@ -1,5 +1,3 @@
-I'm sorry, I was not able to decrypt your message. Are you sure you encrypted it with my public key?
-
 Your signature could not be verified.
 
 - Edward, the friendly GnuPG bot
index c82d1516df63d866af6ca33cc283c8046f796ea5..215717f166230145920fd9ca78d006a9955aaa96 100644 (file)
@@ -1,5 +1,3 @@
-あなたからのメッセージを解読できなくて、すみません。そちらでは暗号化のとき、私の公開鍵を使ってくださったでしょうか?
-
 あなたの署名を認証できませんでした。
 
 - GnuPGボットのEdward
index 864c0c51b8840e0cfd050cd6a58715051871f52c..c4dfde349b0b58c1249a23be1e6548d7405d0305 100644 (file)
@@ -1,5 +1,3 @@
-I'm sorry, I was not able to decrypt your message. Are you sure you encrypted it with my public key?
-
 Your signature was verified.
 
 - Edward, the friendly GnuPG bot
index 864c0c51b8840e0cfd050cd6a58715051871f52c..c4dfde349b0b58c1249a23be1e6548d7405d0305 100644 (file)
@@ -1,5 +1,3 @@
-I'm sorry, I was not able to decrypt your message. Are you sure you encrypted it with my public key?
-
 Your signature was verified.
 
 - Edward, the friendly GnuPG bot
index 864c0c51b8840e0cfd050cd6a58715051871f52c..c4dfde349b0b58c1249a23be1e6548d7405d0305 100644 (file)
@@ -1,5 +1,3 @@
-I'm sorry, I was not able to decrypt your message. Are you sure you encrypted it with my public key?
-
 Your signature was verified.
 
 - Edward, the friendly GnuPG bot