Commit 66ff19a6 authored by Thomas Roessler's avatar Thomas Roessler

When decode-forwarding messages with message/Rfc822 attachments,

mutt should weed the attachments' headers according to the setting
of $forward_weed.
parent 87396ee5
......@@ -496,6 +496,8 @@ _mutt_copy_message (FILE *fpout, FILE *fpin, HEADER *hdr, BODY *body,
s.prefix = prefix;
if (flags & M_CM_DISPLAY)
s.flags |= M_DISPLAY;
if (flags & M_CM_WEED)
s.flags |= M_WEED;
#ifdef _PGPPATH
if (flags & M_CM_VERIFY)
......
......@@ -22,7 +22,7 @@
#define M_CM_DECODE (1<<2) /* decode the message body into text/plain */
#define M_CM_DISPLAY (1<<3) /* output is displayed to the user */
#define M_CM_UPDATE (1<<4) /* update structs on sync */
#define M_CM_WEED (1<<5) /* weed message/rfc822 attachment headers */
#ifdef _PGPPATH
......
......@@ -976,7 +976,7 @@ void message_handler (BODY *a, STATE *s)
if (b->parts)
{
mutt_copy_hdr (s->fpin, s->fpout, off_start, b->parts->offset,
(((s->flags & M_DISPLAY) && option (OPTWEED)) ? (CH_WEED | CH_REORDER) : 0) |
(((s->flags & M_WEED) || ((s->flags & M_DISPLAY) && option (OPTWEED))) ? (CH_WEED | CH_REORDER) : 0) |
(s->prefix ? CH_PREFIX : 0) | CH_DECODE | CH_FROM, s->prefix);
if (s->prefix)
......
......@@ -669,6 +669,7 @@ typedef struct
#define M_PENDINGPREFIX (1<<2) /* prefix to write, but character must follow */
#define M_WEED (1<<3) /* weed headers even when not in display mode */
#define state_set_prefix(s) ((s)->flags |= M_PENDINGPREFIX)
#define state_reset_prefix(s) ((s)->flags &= ~M_PENDINGPREFIX)
......
......@@ -315,8 +315,7 @@ static int include_forward (CONTEXT *ctx, HEADER *cur, FILE *out)
{
char buffer[STRING];
int chflags = CH_DECODE, cmflags = 0;
#ifdef _PGPPATH
if ((cur->pgp & PGPENCRYPT) && option (OPTFORWDECODE))
......@@ -337,7 +336,10 @@ static int include_forward (CONTEXT *ctx, HEADER *cur, FILE *out)
{
cmflags |= M_CM_DECODE;
if (option (OPTFORWWEEDHEADER))
{
chflags |= CH_WEED;
cmflags |= M_CM_WEED;
}
}
if (option (OPTFORWQUOTE))
cmflags |= M_CM_PREFIX;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment