return (0);
}
-int mutt_is_autoview (char *type)
+int mutt_is_autoview (BODY *b, const char *type)
{
LIST *t = AutoViewList;
+ char _type[SHORT_STRING];
int i;
- if (option (OPTIMPLICITAUTOVIEW))
- return 1;
+ if (!type)
+ {
+ snprintf (_type, sizeof (_type), "%s/%s", TYPE (b), b->subtype);
+ type = _type;
+ }
- if (is_mmnoask (type))
- return 1;
-
- while (t)
+ if (mutt_needs_mailcap (b))
+ {
+ if (option (OPTIMPLICITAUTOVIEW))
+ return 1;
+
+ if (is_mmnoask (type))
+ return 1;
+ }
+
+ for (; t; t = t->next)
{
i = mutt_strlen (t->data) - 1;
if ((i > 0 && t->data[i-1] == '/' && t->data[i] == '*' &&
mutt_strncasecmp (type, t->data, i) == 0) ||
mutt_strcasecmp (type, t->data) == 0)
return 1;
- t = t->next;
}
return 0;
while (b)
{
snprintf (buf, sizeof (buf), "%s/%s", TYPE (b), b->subtype);
- if (mutt_is_autoview (buf))
+ if (mutt_is_autoview (b, buf))
{
rfc1524_entry *entry = rfc1524_new_entry ();
char type[STRING];
snprintf (type, sizeof (type), "%s/%s", TYPE (a), a->subtype);
- if (mutt_is_autoview (type))
+ if (mutt_is_autoview (a, type))
return (rfc1524_mailcap_lookup (a, type, NULL, M_AUTOVIEW));
else if (a->type == TYPETEXT)
return (1);
/* first determine which handler to use to process this part */
snprintf (type, sizeof (type), "%s/%s", TYPE (b), b->subtype);
- if (mutt_is_autoview (type))
+ if (mutt_is_autoview (b, type))
{
rfc1524_entry *entry = rfc1524_new_entry ();
int mutt_get_tmp_attachment (BODY *);
int mutt_index_menu (void);
int mutt_invoke_sendmail (ADDRESS *, ADDRESS *, ADDRESS *, const char *, int);
-int mutt_is_autoview (char *);
+int mutt_is_autoview (BODY *, const char *);
int mutt_is_mail_list (ADDRESS *);
int mutt_is_message_type(int, const char *);
int mutt_is_list_recipient (int, ADDRESS *, ADDRESS *);