summaryrefslogtreecommitdiff
path: root/jakob/dynamic/capabilities
diff options
context:
space:
mode:
authorJakob L. Kreuze <zerodaysfordays@sdf.org>2026-02-14 19:50:49 -0500
committerJakob L. Kreuze <zerodaysfordays@sdf.org>2026-02-14 19:50:49 -0500
commit0605db909c9edde1dcbdb6157f18f29ec1112e54 (patch)
tree1d5702d112234f85f2a870d3ad6f7eecb222ff57 /jakob/dynamic/capabilities
parent229b41676baf1cbb719098e25b05cbdd1622e240 (diff)
Show recent comments in sidebar
Diffstat (limited to 'jakob/dynamic/capabilities')
-rw-r--r--jakob/dynamic/capabilities/comments.scm10
1 files changed, 4 insertions, 6 deletions
diff --git a/jakob/dynamic/capabilities/comments.scm b/jakob/dynamic/capabilities/comments.scm
index 7715174..eca05c8 100644
--- a/jakob/dynamic/capabilities/comments.scm
+++ b/jakob/dynamic/capabilities/comments.scm
@@ -97,15 +97,12 @@ This interface exists for dynamically generating the comment view from Haunt."
'())))
(define (handle-get-all-comments limit)
- (let* ((query "SELECT id, slug, name, subject, email, comment, url, approved, reactions, originating_network, reply_to
+ (let* ((query "SELECT id, slug, name, subject, email, comment, url, approved, reactions
FROM comments WHERE approved IS NOT NULL
ORDER BY approved DESC
LIMIT $1")
- (result (exec-query conn query (list limit)))
- (result (map (lambda (comment)
- (append (drop-right comment 1) '(())))
- result)))
- (map (cut apply make-internal-comment~ <>) result)))
+ (result (exec-query conn query (list limit))))
+ (map (lambda (comment) (apply make-internal-comment~ `(,@comment "clearnet" ()))) result)))
(define (get-comments request body)
"API endpoint handler for querying for the comments on a particular post
@@ -126,6 +123,7 @@ This is a wrapper around `get-comments-by-slug'."
(define (get-all-comments request body)
(define (normalize-record record)
+ (write record)
(json-string->scm (internal-comment->json record)))
(let* ((query-string (uri-query (request-uri request)))
(params (if query-string