fedi/src/Fedi/Routes/Inbox.hs
2024-12-17 10:46:59 +02:00

19 lines
513 B
Haskell

module Fedi.Routes.Inbox where
import Fedi.Types
import Fedi.UserDetails
import Web.Twain qualified as Twain
import Web.Twain.Types qualified as Twain
-- * Inbox
matchInbox :: UserDetails -> Twain.PathPattern
matchInbox details =
fromString ("/" <> details.username <> "/inbox")
handleInbox :: (AnyActivity -> Twain.ResponderM Twain.Response) -> Twain.ResponderM b
handleInbox handle = do
activity <- Twain.fromBody
-- sig <- Twain.header "Signature"
response <- handle activity
Twain.send response