<<< Date Index >>>     <<< Thread Index >>>

Re: Bug#190200: pgp-auto-decode patch superfluous with current mutt



On Sun, May 30, 2004 at 03:00:30AM +0900, Derek Martin wrote:
> >     I haven't compared, so let's ask on mutt-dev. If I'm not mistaken,
> > come to mind from previous discussions two advantages:
> 
> Alain,
> 
> I read your posts on the Debian BTS, and you have pretty much summed
> up the situation with the patch as accurately as I know it.  

Recently I had some time to delve into why my patch wasn't working
with latest CVS mutt code.  It turned out to be a bug in mutt, which
is now fixed in the latest CVS code.

I posted this patch somewhere at some time or other... but here it is
again for everyone's convenience.  I tested it against mutt CVS from
about a week ago, and I haven't seen any problems with it.  It would
still be really great if this could be committed to CVS...

Enjoy!

-- 
Derek D. Martin    http://www.pizzashack.org/   GPG Key ID: 0xDFBEAD02
-=-=-=-=-
This message is posted from an invalid address.  Replying to it will result in
undeliverable mail.  Sorry for the inconvenience.  Thank the spammers.

diff -u mutt/commands.c mutt.ddm/commands.c
--- mutt/commands.c     2004-04-13 05:33:33.000000000 +0900
+++ mutt.ddm/commands.c 2004-05-05 15:15:45.000000000 +0900
@@ -953,6 +953,7 @@
     rv = 1;
   }
   
+  h->security |= PGP_TRADITIONAL_CHECKED;
   mx_close_message (&msg);
   return rv;
 }
diff -u mutt/curs_main.c mutt.ddm/curs_main.c
--- mutt/curs_main.c    2004-04-13 05:33:33.000000000 +0900
+++ mutt.ddm/curs_main.c        2004-05-05 15:27:16.000000000 +0900
@@ -1114,7 +1114,7 @@
       case OP_DISPLAY_HEADERS: /* don't weed the headers */
 
        CHECK_MSGCOUNT;
-        CHECK_VISIBLE;
+       CHECK_VISIBLE;
        /*
         * toggle the weeding of headers so that a user can press the key
         * again while reading the message.
@@ -1132,6 +1132,8 @@
            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);
@@ -1808,6 +1810,8 @@
 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;
 
@@ -1818,6 +1822,8 @@
        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;
@@ -1832,6 +1838,8 @@
        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;
@@ -1841,6 +1849,8 @@
        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;
@@ -1959,6 +1969,8 @@
        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 -u mutt/init.h mutt.ddm/init.h
--- mutt/init.h 2004-04-13 17:02:12.000000000 +0900
+++ mutt.ddm/init.h     2004-05-05 15:15:45.000000000 +0900
@@ -1480,6 +1480,17 @@
   ** \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 -u mutt/mutt.h mutt.ddm/mutt.h
--- mutt/mutt.h 2004-04-13 17:02:12.000000000 +0900
+++ mutt.ddm/mutt.h     2004-05-05 15:16:13.000000000 +0900
@@ -445,6 +445,7 @@
   OPTPGPIGNORESUB,
   OPTPGPCHECKEXIT,
   OPTPGPLONGIDS,
+  OPTPGPAUTODEC,
 #if 0
   OPTPGPENCRYPTSELF,
 #endif

Attachment: pgpAu2wMfo9mH.pgp
Description: PGP signature