diff --git a/src/Web/ActivityPub.hs b/src/Web/ActivityPub.hs index bccaa18..ccc09ea 100644 --- a/src/Web/ActivityPub.hs +++ b/src/Web/ActivityPub.hs @@ -154,19 +154,22 @@ instance ActivityPub a => ToJSON (Doc a) where $ "@context" .= jsonldContext (proxy v) <> toSeries h v -data ActorType = ActorTypePerson | ActorTypeOther Text +data ActorType = ActorTypePerson | ActorTypeProject | ActorTypeOther Text instance FromJSON ActorType where - parseJSON = withText "ActorType" $ \ t -> - pure $ case t of - "Person" -> ActorTypePerson - _ -> ActorTypeOther t + parseJSON = withText "ActorType" $ pure . parse + where + parse t + | t == "Person" = ActorTypePerson + | t == frg <> "Project" = ActorTypeProject + | otherwise = ActorTypeOther t instance ToJSON ActorType where toJSON = error "toJSON ActorType" toEncoding at = toEncoding $ case at of ActorTypePerson -> "Person" + ActorTypeProject -> frg <> "Project" ActorTypeOther t -> t {-