Show
Ignore:
Timestamp:
2000-03-16 02:01:43 (9 years ago)
Author:
Thomas Roessler <roessler@…>
Branch:
HEAD
Message:

Add the $print_decode option.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • commands.c

    r1601 r1640  
    233233} 
    234234 
     235static void pipe_print_set_flags (int decode, int *cmflags, int *chflags) 
     236{ 
     237  if (decode) 
     238  { 
     239    *cmflags |= M_CM_DECODE | M_CM_CHARCONV; 
     240    *chflags |= CH_DECODE | CH_REORDER; 
     241     
     242    if (option (OPTWEED)) 
     243    { 
     244      *chflags |= CH_WEED; 
     245      *cmflags |= M_CM_WEED; 
     246    } 
     247  } 
     248} 
     249 
    235250void mutt_pipe_message_to_state (HEADER *h, STATE *s) 
    236251{ 
     
    238253  int chflags = CH_FROM; 
    239254   
    240   if (option (OPTPIPEDECODE)) 
    241   { 
    242     cmflags |= M_CM_DECODE | M_CM_CHARCONV; 
    243     chflags |= CH_DECODE | CH_REORDER; 
    244      
    245     if (option (OPTWEED)) 
    246     { 
    247       chflags |= CH_WEED; 
    248       cmflags |= M_CM_WEED; 
    249     } 
    250   } 
     255  pipe_print_set_flags (option (OPTPIPEDECODE), &cmflags, &chflags); 
    251256   
    252257  if (option (OPTPIPEDECODE)) 
     
    687692} 
    688693 
     694/* XXX - merge this with mutt_pipe_message_to_state? */ 
     695 
    689696static void print_msg (FILE *fp, CONTEXT *ctx, HEADER *h) 
    690697{ 
    691   int cmflags = M_CM_DECODE | M_CM_CHARCONV; 
    692   int chflags = CH_DECODE | CH_REORDER; 
    693  
    694   if (option (OPTWEED)) 
    695   { 
    696     cmflags |= M_CM_WEED; 
    697     chflags |= CH_WEED; 
    698   } 
    699  
    700 #ifdef HAVE_PGP 
    701   if (h->pgp & PGPENCRYPT) 
     698  int cmflags = 0; 
     699  int chflags = CH_FROM; 
     700 
     701  pipe_print_set_flags (option (OPTPRINTDECODE), &cmflags, &chflags); 
     702 
     703#ifdef HAVE_PGP 
     704  if (option (OPTPRINTDECODE) && (h->pgp & PGPENCRYPT)) 
    702705  { 
    703706    if (!pgp_valid_passphrase ()) 
     
    707710#endif 
    708711 
    709   mutt_parse_mime_message (ctx, h); 
     712  if (option (OPTPRINTDECODE)) 
     713    mutt_parse_mime_message (ctx, h); 
     714 
    710715  mutt_copy_message (fp, ctx, h, cmflags, chflags); 
    711716}