]> granicus.if.org Git - neomutt/commitdiff
pgp-auto-decode: When $pgp_auto_decode is set, then mutt will check
authorDerek Martin <invalid@pizzashack.org>
Sat, 12 Feb 2005 19:19:24 +0000 (19:19 +0000)
committerDerek Martin <invalid@pizzashack.org>
Sat, 12 Feb 2005 19:19:24 +0000 (19:19 +0000)
for traditional pgp on certain operations.  This is similar (but NOT
identical) to the behavior known from PGP/MIME messages.

commands.c
curs_main.c
init.h
mutt.h

index 1808b3288de111b7ad89f16df4252f2b7774e9b8..7766bf3905d3f99f9174a2137441ca37504c279f 100644 (file)
@@ -966,6 +966,7 @@ static int _mutt_check_traditional_pgp (HEADER *h, int *redraw)
     rv = 1;
   }
   
+  h->security |= PGP_TRADITIONAL_CHECKED;
   mx_close_message (&msg);
   return rv;
 }
index cd78fce8b03423f0adea942afa3c26f30c3fcf3b..c099e4a620df670e855f72cbb1bdd9d47c1921d1 100644 (file)
@@ -1139,6 +1139,8 @@ CHECK_IMAP_ACL(IMAP_ACL_DELETE);
            menu->current = mutt_thread_next_unread (Context, CURHDR);
        }
  
+       if (option (OPTPGPAUTODEC) && (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED))) 
+         mutt_check_traditional_pgp (tag ? NULL : CURHDR, &menu->redraw);
        if ((op = mutt_display_message (CURHDR)) == -1)
        {
          unset_option (OPTNEEDRESORT);
@@ -1815,6 +1817,8 @@ CHECK_IMAP_ACL(IMAP_ACL_DELETE);
 CHECK_IMAP_ACL(IMAP_ACL_INSERT);
 #endif
 
+       if (option (OPTPGPAUTODEC) && (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED))) 
+         mutt_check_traditional_pgp (tag ? NULL : CURHDR, &menu->redraw);
         mutt_edit_message (Context, tag ? NULL : CURHDR);
        menu->redraw = REDRAW_FULL;
 
@@ -1825,6 +1829,8 @@ CHECK_IMAP_ACL(IMAP_ACL_INSERT);
        CHECK_MSGCOUNT;
         CHECK_VISIBLE;
        CHECK_ATTACH;
+       if (option (OPTPGPAUTODEC) && (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED))) 
+         mutt_check_traditional_pgp (tag ? NULL : CURHDR, &menu->redraw);
        ci_send_message (SENDFORWARD, NULL, NULL, Context, tag ? NULL : CURHDR);
        menu->redraw = REDRAW_FULL;
        break;
@@ -1839,6 +1845,8 @@ CHECK_IMAP_ACL(IMAP_ACL_INSERT);
        CHECK_MSGCOUNT;
         CHECK_VISIBLE;
        CHECK_ATTACH;
+       if (option (OPTPGPAUTODEC) && (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED))) 
+         mutt_check_traditional_pgp (tag ? NULL : CURHDR, &menu->redraw);
        ci_send_message (SENDREPLY|SENDGROUPREPLY, NULL, NULL, Context, tag ? NULL : CURHDR);
        menu->redraw = REDRAW_FULL;
        break;
@@ -1848,6 +1856,8 @@ CHECK_IMAP_ACL(IMAP_ACL_INSERT);
        CHECK_ATTACH;
        CHECK_MSGCOUNT;
         CHECK_VISIBLE;
+       if (option (OPTPGPAUTODEC) && (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED))) 
+         mutt_check_traditional_pgp (tag ? NULL : CURHDR, &menu->redraw);
        ci_send_message (SENDREPLY|SENDLISTREPLY, NULL, NULL, Context, tag ? NULL : CURHDR);
        menu->redraw = REDRAW_FULL;
        break;
@@ -1966,6 +1976,8 @@ CHECK_IMAP_ACL(IMAP_ACL_SEEN);
        CHECK_ATTACH;
        CHECK_MSGCOUNT;
         CHECK_VISIBLE;
+       if (option (OPTPGPAUTODEC) && (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED))) 
+         mutt_check_traditional_pgp (tag ? NULL : CURHDR, &menu->redraw);
        ci_send_message (SENDREPLY, NULL, NULL, Context, tag ? NULL : CURHDR);
        menu->redraw = REDRAW_FULL;
        break;
diff --git a/init.h b/init.h
index 126bdd8cf0f6ec40f5d6cb76f6be5db4c64cd546..12d92c8a475f3f45df42e1c8c059ded1e9f4eb99 100644 (file)
--- a/init.h
+++ b/init.h
@@ -1534,6 +1534,17 @@ struct option_t MuttVars[] = {
   ** \fBdeprecated\fP.
   ** (PGP only)
   */
+  { "pgp_auto_decode", DT_BOOL, R_NONE, OPTPGPAUTODEC, 0 },
+  /*
+  ** .pp
+  ** If set, mutt will automatically attempt to decrypt traditional PGP
+  ** messages whenever the user performs an operation which ordinarily would
+  ** result in the contents of the message being operated on.  For example,
+  ** if the user displays a pgp-traditional message which has not been manually
+  ** checked with the check-traditional-pgp function, mutt will automatically
+  ** check the message for traditional pgp.
+  */
+
 
   /* XXX Default values! */
   
diff --git a/mutt.h b/mutt.h
index ac80b43dc2f79f3ba1bcd5d54c4fc5a5b5582a47..289f6ec0bdd3e5f8a9bc3b06e908e898462d666d 100644 (file)
--- a/mutt.h
+++ b/mutt.h
@@ -461,6 +461,7 @@ enum
   OPTPGPIGNORESUB,
   OPTPGPCHECKEXIT,
   OPTPGPLONGIDS,
+  OPTPGPAUTODEC,
 #if 0
   OPTPGPENCRYPTSELF,
 #endif