From 00a231cdbebd15e4daf843d206bd6f7b6d69ff0a Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Sat, 4 Jun 2022 10:32:57 +0200 Subject: controller: Add /msgid/ route. --- mumi/web/controller.scm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 +;;; Copyright © 2016-2022 Ricardo Wurmus ;;; Copyright © 2022 Arun Isaac ;;; ;;; 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)) -- cgit v1.2.3