view/utils: Hide HTML message parts.
authorRicardo Wurmus <rekado@elephly.net>
Wed, 22 Apr 2020 17:39:39 +0000 (19:39 +0200)
committerRicardo Wurmus <rekado@elephly.net>
Wed, 22 Apr 2020 17:39:39 +0000 (19:39 +0200)
mumi/web/view/utils.scm

index 4811035d964111d5be1ec91069deb1e6853c0e0d..9e9e11f70ccac7758b691e2e7a8c20c6b95d3b0e 100644 (file)
@@ -139,6 +139,9 @@ BUG-NUM), even when it is a multipart message."
                      (number->string message-number)
                      "/" (string-join (map number->string path) "/")))
     (let* ((content-type (assoc-ref headers 'content-type))
+           (html?
+            (and content-type
+                 (eq? 'html (assoc-ref content-type 'subtype))))
            (attachment?
             (and (and=> (assoc-ref headers 'content-disposition)
                         (cut assoc-ref <> 'type))
@@ -152,7 +155,7 @@ BUG-NUM), even when it is a multipart message."
                        (cut assoc-ref <> 'filename))
                 "file")))
       (cond
-       (binary-attachment?
+       ((or html? binary-attachment?)
         `(div (@ (class "attachment"))
               "Attachment: "
               (a (@ (href ,(attachment-url))) ,attachment-name)))