summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mumi/web/view/utils.scm26
1 files changed, 13 insertions, 13 deletions
diff --git a/mumi/web/view/utils.scm b/mumi/web/view/utils.scm
index 69df0c0..2c58467 100644
--- a/mumi/web/view/utils.scm
+++ b/mumi/web/view/utils.scm
@@ -108,7 +108,7 @@
(define (display-message-body bug-num message-number message)
"Convenience procedure to render MESSAGE (part of bug with number
BUG-NUM), even when it is a multipart message."
- (define (display-multipart-chunk headers body . path)
+ (define (display-multipart-chunk headers body path)
(define (attachment-url)
(string-append "/issue/"
(number->string bug-num)
@@ -147,22 +147,22 @@ BUG-NUM), even when it is a multipart message."
(a (@ (href ,(attachment-url)))
"Download"))
,(prettify body))))))
+ (define (display-mime-entity entity . path)
+ (match entity
+ (($ <mime-entity> headers (? string? body))
+ (apply display-multipart-chunk `(,headers ,body ,path)))
+ ;; Message parts can be nested.
+ (($ <mime-entity> headers sub-parts)
+ (map (lambda (part sub-part-num)
+ (apply display-mime-entity part
+ (append path (list sub-part-num))))
+ sub-parts
+ (iota (length sub-parts))))))
(cond
((multipart-message? message)
(let ((parts (email-body message)))
(map (lambda (part part-num)
- (match part
- (($ <mime-entity> headers (? string? body))
- (display-multipart-chunk headers body part-num))
- ;; Message parts can be nested.
- (($ <mime-entity> headers sub-parts)
- (map (lambda (part sub-part-num)
- (match part
- (($ <mime-entity> headers body)
- (display-multipart-chunk
- headers body part-num sub-part-num))))
- sub-parts
- (iota (length sub-parts))))))
+ (display-mime-entity part part-num))
parts
(iota (length parts)))))
;; Regular message with a simple body.