diff options
author | Thomas Roessler <roessler@does-not-exist.org> | 1999-01-07 10:45:47 +0000 |
---|---|---|
committer | Thomas Roessler <roessler@does-not-exist.org> | 1999-01-07 10:45:47 +0000 |
commit | d084dc02709698b298f191947cbb42bb283250a0 (patch) | |
tree | ce6107b9134d2717a1298f67c6ba9dc6a2b78255 /attach.c | |
parent | 246198ae90539dd2429032c1620044dde3d5176e (diff) |
Updated implicit autoview handling from stable.
Diffstat (limited to 'attach.c')
-rw-r--r-- | attach.c | 25 |
1 files changed, 17 insertions, 8 deletions
@@ -320,25 +320,34 @@ static int is_mmnoask (const char *buf) 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; |