]> granicus.if.org Git - neomutt/commitdiff
$include_onlyfirst, again.
authorTAKAHASHI Tamotsu <ttakah@lapis.plala.or.jp>
Wed, 14 Jul 2004 04:36:27 +0000 (04:36 +0000)
committerTAKAHASHI Tamotsu <ttakah@lapis.plala.or.jp>
Wed, 14 Jul 2004 04:36:27 +0000 (04:36 +0000)
copy.c
copy.h
handler.c
init.h
mutt.h
send.c

diff --git a/copy.c b/copy.c
index ff889cde333ad8ee2c398c8846c2e11ef2792149..9e77ba2f7269e661a15500d90fa440691ba37165 100644 (file)
--- a/copy.c
+++ b/copy.c
@@ -586,6 +586,8 @@ _mutt_copy_message (FILE *fpout, FILE *fpin, HEADER *hdr, BODY *body,
       s.flags |= M_WEED;
     if (flags & M_CM_CHARCONV)
       s.flags |= M_CHARCONV;
+    if (flags & M_CM_REPLYING)
+      s.flags |= M_REPLYING;
     
     if (WithCrypto && flags & M_CM_VERIFY)
       s.flags |= M_VERIFY;
diff --git a/copy.h b/copy.h
index c03d5f85c6fa5f8f4bf8658a8fc66084f14a86bc..67568380f04a767e8d39b1a1888e3791971a6f5d 100644 (file)
--- a/copy.h
+++ b/copy.h
@@ -25,6 +25,7 @@
 #define M_CM_WEED      (1<<5)  /* weed message/rfc822 attachment headers */
 #define M_CM_CHARCONV  (1<<6)  /* perform character set conversions */
 #define M_CM_PRINTING  (1<<7)  /* printing the message - display light */
+#define M_CM_REPLYING  (1<<8)  /* replying the message */
 
 
 #define M_CM_DECODE_PGP          (1<<8) /* used for decoding PGP messages */
index 850405951b6c5f5b2c69eb11b0be67d7b8260da4..d425c222b7733cb729ec594ecdd09b77736e16a7 100644 (file)
--- a/handler.c
+++ b/handler.c
@@ -1485,6 +1485,9 @@ void multipart_handler (BODY *a, STATE *s)
     }
     mutt_body_handler (p, s);
     state_putc ('\n', s);
+    if ((s->flags & M_REPLYING)
+       && (option (OPTINCLUDEONLYFIRST)) && (s->flags & M_FIRSTDONE))
+      break;
   }
 
   if (a->encoding == ENCBASE64 || a->encoding == ENCQUOTEDPRINTABLE ||
@@ -1918,6 +1921,7 @@ void mutt_body_handler (BODY *b, STATE *s)
        s->fpin = fp;
       }
     }
+    s->flags |= M_FIRSTDONE;
   }
   else if (s->flags & M_DISPLAY)
   {
@@ -1935,5 +1939,5 @@ void mutt_body_handler (BODY *b, STATE *s)
   }
   
   bail:
-  s->flags = oflags;
+  s->flags = oflags | (s->flags & M_FIRSTDONE);
 }
diff --git a/init.h b/init.h
index f9d631040ef8840f68882633bf89cd3dc2091031..301e7c50263dfb14f42483f7df9c2121c9967e0f 100644 (file)
--- a/init.h
+++ b/init.h
@@ -884,6 +884,12 @@ struct option_t MuttVars[] = {
   ** Controls whether or not a copy of the message(s) you are replying to
   ** is included in your reply.
   */
+  { "include_onlyfirst",       DT_BOOL, R_NONE, OPTINCLUDEONLYFIRST, 0},
+  /*
+  ** .pp
+  ** Controls whether or not Mutt includes only the first attachment
+  ** of the message you are replying.
+  */
   { "indent_string",   DT_STR,  R_NONE, UL &Prefix, UL "> " },
   /*
   ** .pp
diff --git a/mutt.h b/mutt.h
index 829e6b08e2f4e60bb6020783aaf6ceec2d17a579..85afda8fd10cb63208cfcc504f2d9c643822a087 100644 (file)
--- a/mutt.h
+++ b/mutt.h
@@ -374,6 +374,7 @@ enum
   OPTSSLSYSTEMCERTS,
 #endif
   OPTIMPLICITAUTOVIEW,
+  OPTINCLUDEONLYFIRST,
   OPTKEEPFLAGGED,
   OPTMAILCAPSANITIZE,
   OPTMAILDIRTRASH,
@@ -858,6 +859,8 @@ typedef struct
 #define M_WEED          (1<<3) /* weed headers even when not in display mode */
 #define M_CHARCONV     (1<<4) /* Do character set conversions */
 #define M_PRINTING     (1<<5) /* are we printing? - M_DISPLAY "light" */
+#define M_REPLYING     (1<<6) /* are we replying? */
+#define M_FIRSTDONE    (1<<7) /* the first attachment has been done */
 
 #define state_set_prefix(s) ((s)->flags |= M_PENDINGPREFIX)
 #define state_reset_prefix(s) ((s)->flags &= ~M_PENDINGPREFIX)
diff --git a/send.c b/send.c
index cc171e76fae33d65f654828d96ebd55e5404f183..1d791934e84ba077b290d6648c6f320663f9bb97 100644 (file)
--- a/send.c
+++ b/send.c
@@ -403,7 +403,7 @@ void mutt_make_post_indent (CONTEXT *ctx, HEADER *cur, FILE *out)
 
 static int include_reply (CONTEXT *ctx, HEADER *cur, FILE *out)
 {
-  int cmflags = M_CM_PREFIX | M_CM_DECODE | M_CM_CHARCONV;
+  int cmflags = M_CM_PREFIX | M_CM_DECODE | M_CM_CHARCONV | M_CM_REPLYING;
   int chflags = CH_DECODE;
 
   if (WithCrypto && (cur->security & ENCRYPT))