simplifications.
[apps/madmutt.git] / attach.c
index d42e47a..53fac9e 100644 (file)
--- a/attach.c
+++ b/attach.c
@@ -22,7 +22,7 @@
 #include "keymap.h"
 #include "pager.h"
 #include "copy.h"
-#include <lib-crypt/crypt.h>
+#include "crypt.h"
 
 int mutt_get_tmp_attachment (BODY * a)
 {
@@ -370,9 +370,6 @@ int mutt_view_attachment (FILE * fp, BODY * a, int flag, HEADER * hdr,
   int pagerfd = -1;
 
   is_message = mutt_is_message_type(a);
-  if (is_message && a->hdr && (a->hdr->security & ENCRYPT) &&
-      !crypt_valid_passphrase (a->hdr->security))
-    return (rc);
   use_mailcap = (flag == M_MAILCAP ||
                  (flag == M_REGULAR && rfc1524_mailcap_isneeded(a)));
   snprintf (type, sizeof (type), "%s/%s", TYPE (a), a->subtype);
@@ -536,19 +533,10 @@ int mutt_view_attachment (FILE * fp, BODY * a, int flag, HEADER * hdr,
   /* We only reach this point if there have been no errors */
 
   if (use_pager) {
-    pager_t info;
-    p_clear(&info, 1);
-
-    info.fp  = fp;
-    info.bdy = a;
-    info.ctx = Context;
-    info.idx = idx;
-    info.idxlen = idxlen;
-    info.hdr = hdr;
-
-    rc = mutt_do_pager(descrip, pagerfile,
-                       M_PAGER_ATTACHMENT | (is_message ? M_PAGER_MESSAGE : 0),
-                       &info);
+    pager_t info = { Context, hdr, a, fp, idx, idxlen };
+    rc = mutt_pager(descrip, pagerfile,
+                    M_PAGER_ATTACHMENT | (is_message ? M_PAGER_MESSAGE : 0),
+                    &info);
     *pagerfile = '\0';
   }
   else