1
0
Fork 0
mirror of https://code.naskya.net/repos/ndqEd synced 2025-03-20 15:14:54 +09:00

Create Note outbox handler, not in use yet

I wrote a function handleOutboxNote that's supposed to do the whole outbox POST
handler process. There's an outbox item table in the DB now, I adapted things
in various source files. Ticket comment federation work is still in progress.
This commit is contained in:
fr33domlover 2019-03-28 21:08:30 +00:00
parent cdb1c8b121
commit 228e954706
12 changed files with 560 additions and 134 deletions
src/Data/Either

View file

@ -1,6 +1,6 @@
{- This file is part of Vervis.
-
- Written in 2016 by fr33domlover <fr33domlover@riseup.net>.
- Written in 2016, 2019 by fr33domlover <fr33domlover@riseup.net>.
-
- Copying is an act of love. Please copy, reuse and share.
-
@ -16,6 +16,7 @@
module Data.Either.Local
( maybeRight
, maybeLeft
, requireEither
)
where
@ -28,3 +29,9 @@ maybeRight (Right b) = Just b
maybeLeft :: Either a b -> Maybe a
maybeLeft (Left a) = Just a
maybeLeft (Right _) = Nothing
requireEither :: Maybe a -> Maybe b -> Either Bool (Either a b)
requireEither Nothing Nothing = Left False
requireEither (Just _) (Just _) = Left True
requireEither (Just x) Nothing = Right $ Left x
requireEither Nothing (Just y) = Right $ Right y