From: Andrew Engelbrecht Date: Sat, 18 Jul 2015 22:18:34 +0000 (-0400) Subject: added return message quoting X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=f87041f8870e5038a91b2226382a59858db2acd7;p=edward.git added return message quoting --- diff --git a/edward-bot b/edward-bot index 94c4972..634c3de 100755 --- a/edward-bot +++ b/edward-bot @@ -219,17 +219,26 @@ def choose_reply_encryption_key (keys): def generate_reply (plaintext, email_from, email_subject, encrypt_to_key): - plaintext_reply = "thanks for the message!\n\n\n" + plaintext + plaintext_reply = "thanks for the message!\n\n\n" + plaintext_reply += email_quote_text(plaintext) encrypted_reply = encrypt_message(plaintext_reply, encrypt_to_key) reply = "To: " + email_from + "\n" reply += "Subject: " + email_subject + "\n" + reply += "\n" reply += encrypted_reply return reply +def email_quote_text (text): + + quoted_message = re.sub(r'^', r'> ', text, flags=re.MULTILINE) + + return quoted_message + + def encrypt_message (plaintext, encrypt_to_key): gpgme_ctx = gpgme.Context()