summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mumi/web/view/utils.scm11
1 files changed, 10 insertions, 1 deletions
diff --git a/mumi/web/view/utils.scm b/mumi/web/view/utils.scm
index 27cd2de..3c95644 100644
--- a/mumi/web/view/utils.scm
+++ b/mumi/web/view/utils.scm
@@ -18,6 +18,7 @@
;;; <http://www.gnu.org/licenses/>.
(define-module (mumi web view utils)
+ #:use-module (ice-9 format)
#:use-module (ice-9 rdelim)
#:use-module (ice-9 match)
#:use-module (ice-9 regex)
@@ -250,7 +251,15 @@ BUG-NUM), even when it is a multipart message."
((or html? hide-attachment?)
`(div (@ (class "attachment"))
"Attachment: "
- (a (@ (href ,(attachment-url))) ,attachment-name)))
+ (a (@ (href ,(attachment-url))) ,attachment-name)
+ ,(or (and=> (assoc-ref headers 'content-disposition)
+ (lambda (disposition)
+ (and=> (assoc-ref disposition 'size)
+ (lambda (bytes)
+ (format #f " (~1,2f MiB)"
+ (exact->inexact
+ (/ bytes 1024 1024)))))))
+ "")))
((string-suffix? ".scm" attachment-name)
`(div (@ (class "multipart scheme"))
(div (@ (class "download-part"))