summaryrefslogtreecommitdiff
path: root/jakob/dynamic/capabilities/comments.scm
diff options
context:
space:
mode:
authorJakob L. Kreuze <zerodaysfordays@sdf.org>2024-07-19 19:23:09 -0400
committerJakob L. Kreuze <zerodaysfordays@sdf.org>2024-07-21 14:08:34 -0400
commit9c7651e85975572a7c2afc30106e25ff4be9e2ef (patch)
tree43e03535a98b634e2a16cfb34ea68bdfcfa1fc87 /jakob/dynamic/capabilities/comments.scm
parent6b6bd281673554ee44707293535edfad5a9919c1 (diff)
[dynamic] Implement Gotify notifications for comments and RSVPs
Diffstat (limited to 'jakob/dynamic/capabilities/comments.scm')
-rw-r--r--jakob/dynamic/capabilities/comments.scm11
1 files changed, 10 insertions, 1 deletions
diff --git a/jakob/dynamic/capabilities/comments.scm b/jakob/dynamic/capabilities/comments.scm
index ee2a52d..d2e34dc 100644
--- a/jakob/dynamic/capabilities/comments.scm
+++ b/jakob/dynamic/capabilities/comments.scm
@@ -20,6 +20,8 @@
#:use-module (jakob dynamic captcha)
#:use-module (jakob dynamic config)
#:use-module (jakob dynamic errors)
+ #:use-module (jakob dynamic logging)
+ #:use-module (jakob dynamic notify)
#:use-module (jakob dynamic util)
#:use-module (json)
#:use-module (squee)
@@ -173,8 +175,15 @@ This is a wrapper around `get-comments-by-slug'."
(assoc-value form-data "captcha")
(string->number (assoc-value form-data "captcha-id")))
(panic "captcha incorrect")))
+ (log-append! 'debug (format #f "Form data: ~a" form-data))
+ (notify 5
+ (if (assoc "subject" form-data)
+ (format #f "New Comment: ~a" (assoc-value form-data "subject"))
+ "New Comment")
+ (format #f "~a: ~a"
+ (assoc-value form-data "name")
+ (assoc-value form-data "comment")))
(insert-comment form-data)))
-
(define (add-reaction reactions reaction)