summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRicardo Wurmus <rekado@elephly.net>2020-04-22 19:39:39 +0200
committerRicardo Wurmus <rekado@elephly.net>2020-04-22 19:39:39 +0200
commit41de24673434be53830b6adbe7fc5b0a0c62a44e (patch)
tree7b62a134a05b5bd3ad6d80682992b2e782698e39
parentb915aeb1a7671c5bfe3d91adf7027c8c4da7f238 (diff)
view/utils: Hide HTML message parts.
-rw-r--r--mumi/web/view/utils.scm5
1 files changed, 4 insertions, 1 deletions
diff --git a/mumi/web/view/utils.scm b/mumi/web/view/utils.scm
index 4811035..9e9e11f 100644
--- a/mumi/web/view/utils.scm
+++ b/mumi/web/view/utils.scm
@@ -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)))