From 8d55c6ba6fbd97b339e5872af82bd440c82b7292 Mon Sep 17 00:00:00 2001 From: Thomas Roessler Date: Tue, 24 Apr 2001 11:21:22 +0000 Subject: [PATCH] When the character set is changed, ask whether or not mutt should convert. --- commands.c | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/commands.c b/commands.c index f6cbcc7d..49bd4628 100644 --- a/commands.c +++ b/commands.c @@ -811,21 +811,31 @@ void mutt_edit_content_type (HEADER *h, BODY *b, FILE *fp) mutt_parse_content_type (buf, b); - /* inform the user */ - snprintf (tmp, sizeof (tmp), "%s/%s", TYPE (b), NONULL (b->subtype)); type_changed = mutt_strcasecmp (tmp, obuf); charset_changed = mutt_strcasecmp (charset, mutt_get_parameter ("charset", b->parameter)); - + + /* if in send mode, check for conversion - current setting is default. */ + + if (!h && b->type == TYPETEXT && charset_changed) + { + snprintf (tmp, sizeof (tmp), _("Convert to %s upon sending?"), + mutt_get_parameter ("charset", b->parameter)); + b->noconv = !mutt_yesorno (tmp, !b->noconv); + } + + /* inform the user */ + if (type_changed) mutt_message (_("Content-Type changed to %s."), tmp); else if (b->type == TYPETEXT && charset_changed) - mutt_message (_("Character set changed to %s."), - mutt_get_parameter ("charset", b->parameter)); + mutt_message (_("Character set changed to %s; %s."), + mutt_get_parameter ("charset", b->parameter), + b->noconv ? _("not converting") : _("converting")); b->force_charset |= charset_changed ? 1 : 0; - + if (!is_multipart (b) && b->parts) mutt_free_body (&b->parts); if (!mutt_is_message_type (b->type, b->subtype) && b->hdr) -- 2.40.0