post inbox
This commit is contained in:
parent
195072c237
commit
376dbc98f9
1 changed files with 13 additions and 5 deletions
|
@ -34,9 +34,13 @@ routes db detailsFile =
|
||||||
Twain.send $ Twain.html $ H.renderBS $ actorPage details notes
|
Twain.send $ Twain.html $ H.renderBS $ actorPage details notes
|
||||||
, -- Match outbox
|
, -- Match outbox
|
||||||
Twain.get (Fedi.matchOutbox $ unsafePerformIO $ fetchUserDetails detailsFile) do
|
Twain.get (Fedi.matchOutbox $ unsafePerformIO $ fetchUserDetails detailsFile) do
|
||||||
|
request <- Twain.request
|
||||||
|
if Fedi.checkContentTypeAccept request
|
||||||
|
then do
|
||||||
details <- liftIO $ fetchUserDetails detailsFile
|
details <- liftIO $ fetchUserDetails detailsFile
|
||||||
notes <- map (Fedi.ActivityCreate . noteToCreate) <$> liftIO db.getNotes
|
notes <- map (Fedi.ActivityCreate . noteToCreate) <$> liftIO db.getNotes
|
||||||
Fedi.handleOutbox details notes
|
Fedi.handleOutbox details notes
|
||||||
|
else Twain.next
|
||||||
, -- Match Create object
|
, -- Match Create object
|
||||||
Twain.get (Fedi.matchCreateNote $ unsafePerformIO $ fetchUserDetails detailsFile) do
|
Twain.get (Fedi.matchCreateNote $ unsafePerformIO $ fetchUserDetails detailsFile) do
|
||||||
details <- liftIO $ fetchUserDetails detailsFile
|
details <- liftIO $ fetchUserDetails detailsFile
|
||||||
|
@ -44,8 +48,12 @@ routes db detailsFile =
|
||||||
|
|
||||||
Fedi.handleCreateNote details notes
|
Fedi.handleCreateNote details notes
|
||||||
, -- Match inbox
|
, -- Match inbox
|
||||||
Twain.get (Fedi.matchInbox $ unsafePerformIO $ fetchUserDetails detailsFile) do
|
Twain.post (Fedi.matchInbox $ unsafePerformIO $ fetchUserDetails detailsFile) do
|
||||||
|
request <- Twain.request
|
||||||
|
if Fedi.checkContentTypeAccept request
|
||||||
|
then do
|
||||||
Fedi.handleInbox (handleInbox db detailsFile)
|
Fedi.handleInbox (handleInbox db detailsFile)
|
||||||
|
else Twain.next
|
||||||
|
|
||||||
, -- Match Create object
|
, -- Match Create object
|
||||||
Twain.get (Fedi.matchCreateNote $ unsafePerformIO $ fetchUserDetails detailsFile) do
|
Twain.get (Fedi.matchCreateNote $ unsafePerformIO $ fetchUserDetails detailsFile) do
|
||||||
|
|
Loading…
Add table
Reference in a new issue