summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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))