diff options
Diffstat (limited to 'mumi/web/controller.scm')
-rw-r--r-- | mumi/web/controller.scm | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/mumi/web/controller.scm b/mumi/web/controller.scm index efa5c74..bffc26c 100644 --- a/mumi/web/controller.scm +++ b/mumi/web/controller.scm @@ -1,5 +1,5 @@ ;;; mumi -- Mediocre, uh, mail interface -;;; Copyright © 2016, 2017, 2018, 2019, 2020 Ricardo Wurmus <rekado@elephly.net> +;;; Copyright © 2016, 2017, 2018, 2019, 2020, 2021 Ricardo Wurmus <rekado@elephly.net> ;;; ;;; This program is free software: you can redistribute it and/or ;;; modify it under the terms of the GNU Affero General Public License @@ -17,7 +17,7 @@ (define-module (mumi web controller) #:use-module (ice-9 match) - #:use-module (ice-9 pretty-print) + #:use-module (ice-9 format) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) #:use-module (web request) @@ -168,6 +168,21 @@ (string->number msg-num) (map string->number path))) (('GET "issue" (? string->number id) + "patch-set" . patch-set-num) + (let* ((patch-set-num* (match patch-set-num + (() #false) + ((f . rest) f))) + (content (patch-messages id patch-set-num*))) + (if content + (list `((content-type text) + (content-disposition + text/plain + (filename + . ,(format #f "~a-patch-set~:[-~a~;~].mbox" + id patch-set-num* patch-set-num*)))) + content) + (not-found (request-uri request))))) + (('GET "issue" (? string->number id) "raw" (? string->number msg-num)) (download-raw (string->number id) (string->number msg-num))) |