Display most recent post in outbox

parent fc7e61e8
......@@ -105,7 +105,20 @@
`(div ,(post-note-form)
(p "Hi there! This is " ,(users-name) "'s site."))))]))
(h2 "Most recent post in your "
(a (@ (href ,(golem-url get-outbox)))
,(match (db-ref 'outbox)
'(p (i "Hey look... nothing!"))]
[(list post-uri posts-uris ...)
(define activity
(store-get-json post-uri))
(define object
(store-get-json (hash-ref activity 'object)))
`(p ,(hash-ref object 'content))]))
(define (get-inbox req)
......@@ -282,8 +295,22 @@
(define/contract (db-ref collection)
(-> symbol? pair?) ;; technically list? but that's expensive :)
(hash-ref (db) collection))
(-> symbol? (or/c pair? null?)) ; technically list? but that's pricey :)
(hash-ref (db) collection '()))
;;; Store stuff
;;; ===========
(define (store-get-json url [store (magenc-store)])
(define json-str
(lambda (p)
(magenc-get p (if (string? url)
(string->url url)
(call-with-input-string json-str
;;; Application launching
;;; =====================
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment