From 0be09ccaac4ab820c4d994c3c48f49e5676a8ddf Mon Sep 17 00:00:00 2001 From: Andrew Engelbrecht Date: Thu, 21 Jan 2016 16:03:27 -0500 Subject: [PATCH] improve edward output now edward puts all the verifications of message correctness before any quoted message. this has the benefit of making these messages more prominent. --- edward | 20 +++++++++++--------- tests/gpg-flatten-1.out | 8 +++++--- tests/gpg-flatten-2.out | 12 +++++++----- tests/gpg-flatten-4.out | 8 +++++--- tests/gpg-flatten-8.out | 12 +++++++----- 5 files changed, 35 insertions(+), 25 deletions(-) diff --git a/edward b/edward index 060d6d6..1f28371 100755 --- a/edward +++ b/edward @@ -972,15 +972,6 @@ def write_reply (replyinfo_obj): if replyinfo_obj.decrypt_success == True: debug('decrypt success') reply_plain += replyinfo_obj.replies['success_decrypt'] - - if (replyinfo_obj.sig_success == True) and (replyinfo_obj.have_reply_key == True): - debug('message quoted') - reply_plain += replyinfo_obj.replies['space'] - reply_plain += replyinfo_obj.replies['quote_follows'] - reply_plain += "\n\n" - quoted_text = email_quote_text(replyinfo_obj.msg_to_quote) - reply_plain += quoted_text - reply_plain += "\n\n" elif replyinfo_obj.decrypt_failure == True: @@ -1017,6 +1008,17 @@ def write_reply (replyinfo_obj): reply_plain += "\n\n" + if (replyinfo_obj.decrypt_success == True) \ + and (replyinfo_obj.sig_success == True) \ + and (replyinfo_obj.have_reply_key == True): + debug('message quoted') + reply_plain += replyinfo_obj.replies['quote_follows'] + reply_plain += "\n\n" + quoted_text = email_quote_text(replyinfo_obj.msg_to_quote) + reply_plain += quoted_text + reply_plain += "\n\n" + + if (reply_plain == ""): debug('plaintext message') reply_plain += replyinfo_obj.replies['failed_decrypt'] diff --git a/tests/gpg-flatten-1.out b/tests/gpg-flatten-1.out index 934ec63..bae3831 100644 --- a/tests/gpg-flatten-1.out +++ b/tests/gpg-flatten-1.out @@ -1,4 +1,8 @@ -I received your message and decrypted it. Here's a copy of your message: +I received your message and decrypted it. + +Your signature was verified. + +Here's a copy of your message: > thanks for the message! > @@ -15,8 +19,6 @@ I received your message and decrypted it. Here's a copy of your message: > > -Your signature was verified. - - Edward, the friendly GnuPG bot The Free Software Foundation created me. diff --git a/tests/gpg-flatten-2.out b/tests/gpg-flatten-2.out index 6830350..0e56086 100644 --- a/tests/gpg-flatten-2.out +++ b/tests/gpg-flatten-2.out @@ -1,6 +1,12 @@ Hello, I am Edward, the friendly GnuPG bot. -I received your message and decrypted it. Here's a copy of your message: +I received your message and decrypted it. + +Your signature was verified. + +I received your public key. Thanks. + +Here's a copy of your message: > thanks for the message! > @@ -18,10 +24,6 @@ I received your message and decrypted it. Here's a copy of your message: > > -Your signature was verified. - -I received your public key. Thanks. - - Edward, the friendly GnuPG bot The Free Software Foundation created me. diff --git a/tests/gpg-flatten-4.out b/tests/gpg-flatten-4.out index 5148e53..a1dbd96 100644 --- a/tests/gpg-flatten-4.out +++ b/tests/gpg-flatten-4.out @@ -1,4 +1,8 @@ -あなたから送られたメールの暗号を解きました。確認のため、内容を返信します: +あなたから送られたメールの暗号を解きました。 + +あなたの署名を確認できました。 + +確認のため、内容を返信します: > thanks for the message! > @@ -15,8 +19,6 @@ > > - あなたの署名を確認できました。 - - GnuPGボットのEdward Free Software Foundationが私を制作しました。 Free Software Foundationに寄付しませんか。| https://www.fsf.org/donate diff --git a/tests/gpg-flatten-8.out b/tests/gpg-flatten-8.out index 6419c90..c2e6ce0 100644 --- a/tests/gpg-flatten-8.out +++ b/tests/gpg-flatten-8.out @@ -1,6 +1,12 @@ Hello, I am Edward, the friendly GnuPG bot. -I received your message and decrypted it. Here's a copy of your message: +I received your message and decrypted it. + +Your signature was verified. + +I received your public key. Thanks. + +Here's a copy of your message: > > Über Spaß. > > @@ -14,10 +20,6 @@ I received your message and decrypted it. Here's a copy of your message: > > -Your signature was verified. - -I received your public key. Thanks. - - Edward, the friendly GnuPG bot The Free Software Foundation created me. -- 2.25.1