From 41de24673434be53830b6adbe7fc5b0a0c62a44e Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Wed, 22 Apr 2020 19:39:39 +0200 Subject: view/utils: Hide HTML message parts. --- mumi/web/view/utils.scm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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))) -- cgit v1.2.3