summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRicardo Wurmus <rekado@elephly.net>2022-06-04 10:32:57 +0200
committerRicardo Wurmus <rekado@elephly.net>2022-06-04 10:32:57 +0200
commit00a231cdbebd15e4daf843d206bd6f7b6d69ff0a (patch)
tree6e2da177d227c01c71de8b181f81020666d68a6a
parente3dfc51d3a5fff5ed05b9859560dc1502b3bcc8b (diff)
controller: Add /msgid/ route.
-rw-r--r--mumi/web/controller.scm8
1 files changed, 7 insertions, 1 deletions
diff --git a/mumi/web/controller.scm b/mumi/web/controller.scm
index 3b91021..10252dd 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, 2021 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2016-2022 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2022 Arun Isaac <arunisaac@systemreboot.net>
;;;
;;; This program is free software: you can redistribute it and/or
@@ -36,6 +36,7 @@
#:use-module (mumi web graphql)
#:use-module (mumi web util)
#:use-module (mumi web view html)
+ #:use-module ((mumi xapian) #:select (search))
#:export (controller))
(define-syntax-rule (-> target functions ...)
@@ -128,6 +129,11 @@
(render-html page #:extra-headers headers)
(render-html (unknown id))))
(render-html (unknown id)))))
+ (('GET "msgid" msgid)
+ (match (search (format #false "msgid:~a" (string-hash msgid)))
+ ((id . rest)
+ (redirect (list "issue" id)))
+ (_ (render-html (unknown msgid)))))
(('POST "issue" (? string->number id) "comment")
(if (mailer-enabled?)
(let ((headers (request-headers request))