]> granicus.if.org Git - neomutt/commitdiff
Introduce $content_type. There's one change against Michael's
authorMichael Elkins <me@sigpipe.org>
Mon, 9 Sep 2002 20:09:52 +0000 (20:09 +0000)
committerMichael Elkins <me@sigpipe.org>
Mon, 9 Sep 2002 20:09:52 +0000 (20:09 +0000)
patch, in how the "format=flowed" parameter is used.

globals.h
init.h
send.c

index a654686a26f750ea51f51d4fc20054a994490d43..d4d8f92ad7b8341494923858370eacd67a5ae5f9 100644 (file)
--- a/globals.h
+++ b/globals.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 1996-2000 Michael R. Elkins <me@cs.hmc.edu>
+ * Copyright (C) 1996-2002 Michael R. Elkins <me@mutt.org>
  * 
  *     This program is free software; you can redistribute it and/or modify
  *     it under the terms of the GNU General Public License as published by
@@ -37,6 +37,7 @@ WHERE char *Attribution;
 WHERE char *AttachFormat;
 WHERE char *Charset;
 WHERE char *ComposeFormat;
+WHERE char *ContentType;
 WHERE char *DefaultHook;
 WHERE char *DateFmt;
 WHERE char *DisplayFilter;
diff --git a/init.h b/init.h
index 30970ec1d81da4dc94f58a3dec66dae8904c7206..aacc98d53bea7ded14b2fc8c2a4b9c0af0590726 100644 (file)
--- a/init.h
+++ b/init.h
@@ -343,6 +343,11 @@ struct option_t MuttVars[] = {
   ** many seconds if the connection is not able to be established.  A negative
   ** value causes Mutt to wait indefinitely for the connection to succeed.
   */
+  { "content_type",    DT_STR, R_NONE, UL &ContentType, UL "text/plain" },
+  /*
+  ** .pp
+  ** Sets the default Content-Type for the body of newly composed messages.
+  */
   { "copy",            DT_QUAD, R_NONE, OPT_COPY, M_YES },
   /*
   ** .pp
diff --git a/send.c b/send.c
index f44aebb099d7bb1498a34a95ac0b3ab36f458cf1..8c315d2af63c82ccd172b3161e92eee74cc175ce 100644 (file)
--- a/send.c
+++ b/send.c
@@ -1102,12 +1102,11 @@ ci_send_message (int flags,             /* send mode */
     pbody->next = msg->content; /* don't kill command-line attachments */
     msg->content = pbody;
     
-    msg->content->type = TYPETEXT;
-    msg->content->subtype = safe_strdup ("plain");
+    mutt_parse_content_type (ContentType, msg->content);
     msg->content->unlink = 1;
     msg->content->use_disp = 0;
     msg->content->disposition = DISPINLINE;
-    if (option (OPTTEXTFLOWED))
+    if (option (OPTTEXTFLOWED) && msg->content->type == TYPETEXT && !ascii_strcasecmp (msg->content->subtype, "plain"))
       mutt_set_parameter ("format", "flowed", &msg->content->parameter);
     
     if (!tempfile)