1
0
Fork 0
mirror of https://code.sup39.dev/repos/Wqawg synced 2024-12-29 00:54:52 +09:00

Implement getOutboxItemR, serving AS2 and basic HTML

This commit is contained in:
fr33domlover 2019-05-18 10:09:47 +00:00
parent 6d304b9307
commit f07b56c259

View file

@ -309,7 +309,20 @@ getOutboxR :: ShrIdent -> Handler TypedContent
getOutboxR = error "Not implemented yet"
getOutboxItemR :: ShrIdent -> KeyHashid OutboxItem -> Handler TypedContent
getOutboxItemR = error "Not implemented yet"
getOutboxItemR shr obkhid = do
obid <- decodeKeyHashid404 obkhid
doc <- runDB $ do
sid <- getKeyBy404 $ UniqueSharer shr
pid <- getKeyBy404 $ UniquePersonIdent sid
ob <- get404 obid
unless (outboxItemPerson ob == pid) notFound
return $ persistJSONValue $ outboxItemActivity ob
selectRep $ do
provideAP $ pure doc
provideRep $ defaultLayout $
[whamlet|
<div><pre>#{AEP.encodePrettyToLazyText doc}
|]
postOutboxR :: ShrIdent -> Handler Html
postOutboxR shrAuthor = do