/* We don't support multipart messages in the compose menu yet */
if (!compose && !m->collapsed
&& ((m->type == TYPEMULTIPART && !mutt_is_multipart_encrypted(m))
- || mutt_is_message_type (m->type, m->subtype)))
+ || mutt_is_message_type(m)))
{
idx = mutt_gen_attach_list (m->parts, m->type, idx, idxlen, idxmax,
level + 1, compose);
mutt_format_s (dest, destlen, prefix, aptr->content->description);
break;
}
- if (mutt_is_message_type (aptr->content->type, aptr->content->subtype)
- && MsgFmt && aptr->content->hdr) {
+ if (mutt_is_message_type(aptr->content) && MsgFmt && aptr->content->hdr)
+ {
char s[SHORT_STRING];
_mutt_make_string (s, sizeof (s), MsgFmt, NULL, aptr->content->hdr,
}
}
else if (aptr->content->description ||
- (mutt_is_message_type
- (aptr->content->type, aptr->content->subtype)
+ (mutt_is_message_type(aptr->content)
&& MsgFmt && aptr->content->hdr))
break;
/* FALLS THROUGH TO 'f' */
return cur->tagged - ot;
}
-int mutt_is_message_type (int type, const char *subtype)
-{
- if (type != TYPEMESSAGE)
- return 0;
-
- subtype = NONULL (subtype);
- return (ascii_strcasecmp (subtype, "rfc822") == 0
- || ascii_strcasecmp (subtype, "news") == 0);
-}
-
static int mutt_query_save_attachment (FILE * fp, BODY * body, HEADER * hdr,
char **directory)
{
else if (body->hdr &&
body->encoding != ENCBASE64 &&
body->encoding != ENCQUOTEDPRINTABLE &&
- mutt_is_message_type (body->type, body->subtype))
+ mutt_is_message_type(body))
mutt_default_save (buf, sizeof (buf), body->hdr);
else
buf[0] = 0;
body->hdr &&
body->encoding != ENCBASE64 &&
body->encoding != ENCQUOTEDPRINTABLE &&
- mutt_is_message_type (body->type, body->subtype));
+ mutt_is_message_type(body));
if (is_message) {
struct stat st;
for (; b; b = b->next) {
i = init || b->collapsed;
if (i && option (OPTDIGESTCOLLAPSE) && b->type == TYPEMULTIPART
- && !ascii_strcasecmp (b->subtype, "digest"))
+ && mime_which_token(b->subtype, -1) == MIME_DIGEST)
attach_collapse (b->parts, 1, 1, 0);
- else if (b->type == TYPEMULTIPART
- || mutt_is_message_type (b->type, b->subtype))
+ else if (b->type == TYPEMULTIPART || mutt_is_message_type(b))
attach_collapse (b->parts, collapse, i, 0);
b->collapsed = collapse;
if (just_one)
}
}
-static const char *Function_not_permitted =
-N_("Function not permitted in attach-message mode.");
-
-#define CHECK_ATTACH if(option(OPTATTACHMSG)) \
- {\
- mutt_flushinp (); \
- mutt_error _(Function_not_permitted); \
- break; \
- }
-
-
-
-
void mutt_view_attachments (HEADER * hdr)
{
int secured = 0;
attach_collapse (cur, 0, 1, 0);
mutt_update_attach_index (cur, &idx, &idxlen, &idxmax, menu);
+#define CHECK_ATTACH \
+ if (option(OPTATTACHMSG)) { \
+ mutt_flushinp (); \
+ mutt_error _("Function not permitted in attach-message mode."); \
+ break; \
+ }
+
for (;;) {
if (op == OP_NULL)
- op = mutt_menuLoop (menu);
+ op = mutt_menuLoop(menu);
switch (op) {
case OP_ATTACH_VIEW_MAILCAP:
mutt_view_attachment (fp, idx[menu->current]->content, M_MAILCAP,
op = OP_NULL;
}
-
/* not reached */
}
static short check_msg (BODY * b, short err)
{
- if (!mutt_is_message_type (b->type, b->subtype)) {
+ if (!mutt_is_message_type(b)) {
if (err)
mutt_error _("You may only bounce message/rfc822 parts.");
break;
while (--i >= 0) {
- if (mutt_is_message_type
- (idx[i]->content->type, idx[i]->content->subtype)) {
+ if (mutt_is_message_type(idx[i]->content)) {
nchildren = count_tagged_children (idx, idxlen, i);
if (nchildren == nattach)
return idx[i]->content->hdr;
if (cur) {
for (i = 0; i < idxlen; i++) {
- if (mutt_is_message_type
- (idx[i]->content->type, idx[i]->content->subtype)
+ if (mutt_is_message_type(idx[i]->content)
&& is_parent (i, idx, idxlen, cur))
parent = idx[i]->content->hdr;
if (idx[i]->content == cur)