]> granicus.if.org Git - neomutt/commitdiff
Merge in the mailcap patch from stable.
authorThomas Roessler <roessler@does-not-exist.org>
Thu, 7 Jan 1999 09:57:04 +0000 (09:57 +0000)
committerThomas Roessler <roessler@does-not-exist.org>
Thu, 7 Jan 1999 09:57:04 +0000 (09:57 +0000)
attach.c
commands.c
hdrline.c
init.h
mutt.h
mx.c

index b18b6620952e1a9147f156bfff90849bd9daf12e..14171704dbd39dbdd78143aa8f4ef90c8525a87a 100644 (file)
--- a/attach.c
+++ b/attach.c
@@ -276,11 +276,61 @@ int mutt_edit_attachment (BODY *a)
   return rc;
 }
 
+
+/* for compatibility with metamail */
+static int is_mmnoask (const char *buf)
+{
+  char tmp[LONG_STRING], *p, *q;
+  int lng;
+
+  if ((p = getenv ("MM_NOASK")) != NULL && *p)
+  {
+    if (mutt_strcmp (p, "1") == 0)
+      return (1);
+
+    strfcpy (tmp, p, sizeof (tmp));
+    p = tmp;
+
+    while ((p = strtok (p, ",")) != NULL)
+    {
+      if ((q = strrchr (p, '/')) != NULL)
+      {
+       if (*(q+1) == '*')
+       {
+         if (mutt_strncasecmp (buf, p, q-p) == 0)
+           return (1);
+       }
+       else
+       {
+         if (mutt_strcasecmp (buf, p) == 0)
+           return (1);
+       }
+      }
+      else
+      {
+       lng = mutt_strlen (p);
+       if (buf[lng] == '/' && mutt_strncasecmp (buf, p, lng) == 0)
+         return (1);
+      }
+
+      p = NULL;
+    }
+  }
+
+  return (0);
+}
+
 int mutt_is_autoview (char *type)
 {
   LIST *t = AutoViewList;
   int i;
 
+  if (option (OPTIMPLICITAUTOVIEW))
+    return 1;
+
+  if (is_mmnoask (type))
+    return 1;
+  
   while (t)
   {
     i = mutt_strlen (t->data) - 1;
index f2be30aa5c867f0aacd6a8d309c941edbe128470..82765900f99401464c7cda9847f518cd3503c332 100644 (file)
@@ -60,49 +60,6 @@ extern char *ReleaseDate;
 /* The folder the user last saved to.  Used by ci_save_message() */
 static char LastSaveFolder[_POSIX_PATH_MAX] = "";
 
-/* for compatibility with metamail */
-static int is_mmnoask (const char *buf)
-{
-  char tmp[LONG_STRING], *p, *q;
-  int lng;
-
-  if ((p = getenv ("MM_NOASK")) != NULL && *p)
-  {
-    if (mutt_strcmp (p, "1") == 0)
-      return (1);
-
-    strfcpy (tmp, p, sizeof (tmp));
-    p = tmp;
-
-    while ((p = strtok (p, ",")) != NULL)
-    {
-      if ((q = strrchr (p, '/')) != NULL)
-      {
-       if (*(q+1) == '*')
-       {
-         if (mutt_strncasecmp (buf, p, q-p) == 0)
-           return (1);
-       }
-       else
-       {
-         if (mutt_strcasecmp (buf, p) == 0)
-           return (1);
-       }
-      }
-      else
-      {
-       lng = mutt_strlen (p);
-       if (buf[lng] == '/' && mutt_strncasecmp (buf, p, lng) == 0)
-         return (1);
-      }
-
-      p = NULL;
-    }
-  }
-
-  return (0);
-}
-
 int mutt_display_message (HEADER *cur)
 {
   char tempfile[_POSIX_PATH_MAX], buf[LONG_STRING];
@@ -113,29 +70,6 @@ int mutt_display_message (HEADER *cur)
   snprintf (buf, sizeof (buf), "%s/%s", TYPE (cur->content),
            cur->content->subtype);
 
-  if (cur->mailcap && !mutt_is_autoview (buf))
-  {
-    if (is_mmnoask (buf))
-      rc = M_YES;
-    else
-      rc = query_quadoption (OPT_USEMAILCAP, 
-                       _("Display message using mailcap?"));
-    if (rc < 0)
-      return 0;
-    else if (rc == M_YES)
-    {
-      MESSAGE *msg;
-
-      if ((msg = mx_open_message (Context, cur->msgno)) != NULL)
-      {
-       mutt_view_attachment (msg->fp, cur->content, M_REGULAR);
-       mx_close_message (&msg);
-       mutt_set_flag (Context, cur, M_READ, 1);
-      }
-      return 0;
-    }
-  }
-
   mutt_parse_mime_message (Context, cur);
 
 
index 988c840198f82def87047594bd879e7febc566d6..89c5ad543d1b40feaf311a4a727814926cabeec1 100644 (file)
--- a/hdrline.c
+++ b/hdrline.c
@@ -595,13 +595,11 @@ hdr_format_str (char *dest,
       break;
 
     case 'Z':
-      if (hdr->mailcap)
-       ch = 'M';
-
-
+    
+      ch = ' ';
 
 #ifdef _PGPPATH
-      else if (hdr->pgp & PGPENCRYPT)
+      if (hdr->pgp & PGPENCRYPT)
        ch = 'P';
       else if (hdr->pgp & PGPSIGN)
         ch = 'S';
@@ -609,10 +607,6 @@ hdr_format_str (char *dest,
         ch = 'K';
 #endif
 
-
-
-      else
-       ch = ' ';
       snprintf (fmt, sizeof (fmt), "%%%ss", prefix);
       snprintf (buf2, sizeof (buf2),
                "%c%c%c", (THREAD_NEW ? 'n' : (THREAD_OLD ? 'o' : 
diff --git a/init.h b/init.h
index 17845785da50ebe3e98fd71ba411c7bcb40aaf37..9edc74cd577e3cbdb03d8f5e17e20fdad9a7539a 100644 (file)
--- a/init.h
+++ b/init.h
@@ -127,6 +127,7 @@ struct option_t MuttVars[] = {
   { "imap_pass",       DT_STR,  R_NONE, UL &ImapPass, UL 0 },
   { "imap_checkinterval",      DT_NUM,  R_NONE, UL &ImapCheckTime, 0 },
 #endif
+  { "implicit_autoview", DT_BOOL,R_NONE, OPTIMPLICITAUTOVIEW, 0},
   { "in_reply_to",     DT_STR,  R_NONE, UL &InReplyTo, UL "%i; from %n on %{!%a, %b %d, %Y at %I:%M:%S%p %Z}" },
   { "include",         DT_QUAD, R_NONE, OPT_INCLUDE, M_ASKYES },
   { "indent_string",   DT_STR,  R_NONE, UL &Prefix, UL "> " },
@@ -268,7 +269,6 @@ struct option_t MuttVars[] = {
   { "use_8bitmime",    DT_BOOL, R_NONE, OPTUSE8BITMIME, 0 },
   { "use_domain",      DT_BOOL, R_NONE, OPTUSEDOMAIN, 1 },
   { "use_from",                DT_BOOL, R_NONE, OPTUSEFROM, 1 },
-  { "use_mailcap",     DT_QUAD, R_NONE, OPT_USEMAILCAP, M_ASKNO },
   { "visual",          DT_PATH, R_NONE, UL &Visual, 0 },
   { "wait_key",                DT_BOOL, R_NONE, OPTWAITKEY, 1 },
   { "wrap_search",     DT_BOOL, R_NONE, OPTWRAPSEARCH, 1 },
diff --git a/mutt.h b/mutt.h
index 4ca1b6f701fb49f7df537cf57e58ce81ed97e360..2a82e0fb1d0e92e32d29e25030d09be3c1a90d03 100644 (file)
--- a/mutt.h
+++ b/mutt.h
@@ -246,7 +246,6 @@ enum
   OPT_VERIFYSIG, /* verify PGP signatures */
 #endif
 
-  OPT_USEMAILCAP,
   OPT_PRINT,
   OPT_INCLUDE,
   OPT_DELETE,
@@ -302,6 +301,7 @@ enum
   OPTHELP,
   OPTHIDDENHOST,
   OPTIGNORELISTREPLYTO,
+  OPTIMPLICITAUTOVIEW,
   OPTMARKERS,
   OPTMARKOLD,
   OPTMENUSCROLL,       /* scroll menu instead of implicit next-page */
@@ -520,7 +520,6 @@ typedef struct header
 #endif
 
   unsigned int mime : 1;    /* has a Mime-Version header? */
-  unsigned int mailcap : 1; /* requires mailcap to display? */
   unsigned int flagged : 1; /* marked important? */
   unsigned int tagged : 1;
   unsigned int deleted : 1;
diff --git a/mx.c b/mx.c
index aed1be415ca06632bb1ebb9c4e5a07677283f5cd..2142864243978d66e25b43a53d3853a60845c014 100644 (file)
--- a/mx.c
+++ b/mx.c
@@ -1306,13 +1306,8 @@ void mx_update_context (CONTEXT *ctx)
 #ifdef _PGPPATH
   /* NOTE: this _must_ be done before the check for mailcap! */
   h->pgp = pgp_query (h->content);
-  if (!h->pgp)
 #endif /* _PGPPATH */
 
-
-
-    if (mutt_needs_mailcap (h->content))
-      h->mailcap = 1;
   if (h->flagged)
     ctx->flagged++;
   if (h->deleted)