summaryrefslogtreecommitdiffstats
path: root/compose.c
diff options
context:
space:
mode:
authorThomas Roessler <roessler@does-not-exist.org>2000-01-08 09:38:10 +0000
committerThomas Roessler <roessler@does-not-exist.org>2000-01-08 09:38:10 +0000
commit54c92539c2c22104ae6f04412254acb2de3bdc3d (patch)
treea48aea660981da64bd5392f129fd3c2690b1995c /compose.c
parent33acfb1e353466b3668b7c54cc884ddf4e8ef092 (diff)
Unified edit-type function for the index, compose, and
receive-attachment menus. Mostly by Michael Elkins.
Diffstat (limited to 'compose.c')
-rw-r--r--compose.c49
1 files changed, 4 insertions, 45 deletions
diff --git a/compose.c b/compose.c
index 2ae3678d..d49a22d7 100644
--- a/compose.c
+++ b/compose.c
@@ -850,54 +850,13 @@ int mutt_compose_menu (HEADER *msg, /* structure for new message */
}
break;
- case OP_COMPOSE_EDIT_TYPE:
+ case OP_EDIT_TYPE:
CHECK_COUNT;
- snprintf (buf, sizeof (buf), "%s/%s",
- TYPE (idx[menu->current]->content),
- idx[menu->current]->content->subtype);
- if (mutt_get_field ("Content-Type: ", buf, sizeof (buf), 0) == 0 && buf[0])
- {
- char *s;
- PARAMETER *par;
- BODY *b;
-
- b = idx[menu->current]->content;
-
- s = b->filename; par = b->parameter;
- b->filename = NULL; b->parameter = NULL;
-
- mutt_parse_content_type (buf, b);
-
- safe_free ((void **) &b->filename);
- b->filename = s;
-
- if ((s = mutt_get_parameter("charset", b->parameter)))
- mutt_set_parameter("charset", s, &par);
-
- /* These are needed for "traditional" PGP.
- * Should we switch to a "negative list" instead?
- */
-
- if ((s = mutt_get_parameter("x-action", b->parameter)))
- mutt_set_parameter("x-action", s, &par);
- if ((s = mutt_get_parameter("format", b->parameter)))
- mutt_set_parameter("format", s, &par);
-
- /* ignore the other parameters for now */
- mutt_free_parameter(&b->parameter);
- b->parameter = par;
-
- /* this may have been a "structured" message */
- if (b->parts)
- mutt_free_body (&b->parts);
- if (b->hdr)
- {
- b->hdr->content = NULL;
- mutt_free_header (&b->hdr);
- }
+ {
+ mutt_edit_content_type (NULL, idx[menu->current]->content);
/* this may have been a change to text/something */
- mutt_update_encoding (b);
+ mutt_update_encoding (idx[menu->current]->content);
menu->redraw = REDRAW_CURRENT;
}