]> granicus.if.org Git - mutt/commitdiff
Vikas' forward_attachment patch.
authorThomas Roessler <roessler@does-not-exist.org>
Tue, 23 Mar 1999 20:21:49 +0000 (20:21 +0000)
committerThomas Roessler <roessler@does-not-exist.org>
Tue, 23 Mar 1999 20:21:49 +0000 (20:21 +0000)
init.h
mutt.h
postpone.c
recvattach.c

diff --git a/init.h b/init.h
index f40904b7f9ad6a7aef08aa36517e922eddebc8f9..fa434eef68a331a680341140af74e8df1ee0c124 100644 (file)
--- a/init.h
+++ b/init.h
@@ -112,6 +112,8 @@ struct option_t MuttVars[] = {
   { "folder_format",   DT_STR,  R_NONE, UL &FolderFormat, UL "%N %F %2l %-8.8u %-8.8g %8s %d %f" },
   { "followup_to",     DT_BOOL, R_NONE, OPTFOLLOWUPTO, 1 },
   { "force_name",      DT_BOOL, R_NONE, OPTFORCENAME, 0 },
+  { "forward_attachment", DT_BOOL, R_NONE, OPTFORWATTACH, 0 },
+  { "forw_attachment",  DT_SYN, R_NONE, UL "forward_attachment", 0 },
   { "forward_decode",  DT_BOOL, R_NONE, OPTFORWDECODE, 1 },
   { "forw_decode",     DT_SYN,  R_NONE, UL "forward_decode", 0 },
   { "forward_weed",    DT_BOOL, R_NONE, OPTFORWWEEDHEADER, 1 },
diff --git a/mutt.h b/mutt.h
index 4e704fd1e8cb87252c65693b62d27e0dabb47106..7e166d7ef39c4141e254b2d18833f149e9fd693e 100644 (file)
--- a/mutt.h
+++ b/mutt.h
@@ -301,6 +301,7 @@ enum
   OPTFCCATTACH,
   OPTFOLLOWUPTO,
   OPTFORCENAME,
+  OPTFORWATTACH,
   OPTFORWDECODE,
   OPTFORWWEEDHEADER,
   OPTFORWQUOTE,
index afb6d3460273f95ee216c156ced31addd39c7b37..881be40d200051ecf2b5833eb3272d16f532267e 100644 (file)
@@ -468,7 +468,11 @@ int mutt_prepare_edit_message (CONTEXT *ctx, HEADER *newhdr, HEADER *hdr)
   }
   else
   {
-    mutt_mktemp (file);
+    BODY *b = hdr->content;
+    file[0] = 0;
+    if (b->filename)
+      strfcpy (file, b->filename, sizeof (file));
+    mutt_adv_mktemp (file, sizeof(file));
     if (mutt_save_attachment (msg->fp, hdr->content, file, 0, NULL) == -1)
     {
       mutt_free_envelope (&newhdr->env);
@@ -479,10 +483,12 @@ int mutt_prepare_edit_message (CONTEXT *ctx, HEADER *newhdr, HEADER *hdr)
     
     FREE (&newhdr->content->subtype);
     FREE (&newhdr->content->xtype);
+    FREE (&newhdr->content->description);
     
     newhdr->content->type = hdr->content->type;
     newhdr->content->xtype = safe_strdup (hdr->content->xtype);
     newhdr->content->subtype = safe_strdup (hdr->content->subtype);
+    newhdr->content->description = safe_strdup (hdr->content->description);
 
     for (par = hdr->content->parameter; par; par = par->next)
       mutt_set_parameter (par->attribute, par->value, &newhdr->content->parameter);
index baabd659a730199d055707674992a952761bc545..217a59c3456593e82ce4fde0e4f091232f2c5647 100644 (file)
@@ -816,8 +816,17 @@ static void reply_attachment_list (int op, int tag, HEADER *hdr, BODY *body)
     ctx = mx_open_mailbox (tempfile, M_QUIET, NULL);
     hn = ctx->hdrs[0];
   }
-
-  ci_send_message (op, NULL, NULL, ctx, hn);
+  
+  if (op == SENDFORWARD && option (OPTFORWATTACH))
+  {
+    HEADER *newhdr = mutt_new_header();
+    mutt_prepare_edit_message (ctx, newhdr, hn);
+    mutt_free_envelope (&newhdr->env);
+    newhdr->env = mutt_new_envelope();
+    ci_send_message (0, newhdr, NULL, ctx, NULL);
+  }
+  else
+    ci_send_message (op, NULL, NULL, ctx, hn);
 
   if (hn->replied && !hdr->replied)
     mutt_set_flag (Context, hdr, M_REPLIED, 1);