From 3cda2205c5c286ce6138edac9951875cebb6883d Mon Sep 17 00:00:00 2001 From: fr33domlover Date: Mon, 25 Jul 2022 09:10:24 +0000 Subject: [PATCH] Web.ActivityPub: Remove fake extContext, the URI doesn't work anymore anyway --- src/Web/ActivityPub.hs | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/src/Web/ActivityPub.hs b/src/Web/ActivityPub.hs index bc43e8f..761b637 100644 --- a/src/Web/ActivityPub.hs +++ b/src/Web/ActivityPub.hs @@ -171,9 +171,6 @@ secContext = "https://w3id.org/security/v2" forgeContext :: Text forgeContext = "https://forgefed.org/ns" -extContext :: Text -extContext = "https://angeley.es/as2-ext" - publicURI :: Text publicURI = "https://www.w3.org/ns/activitystreams#Public" @@ -237,7 +234,7 @@ data PublicKey u = PublicKey } instance ActivityPub PublicKey where - jsonldContext _ = [secContext, extContext] + jsonldContext _ = [secContext] parseObject o = do mtyp <- optional $ o .: "@type" <|> o .: "type" for_ mtyp $ \ t -> @@ -334,7 +331,7 @@ data SshPublicKey u = SshPublicKey } instance ActivityPub SshPublicKey where - jsonldContext _ = [secContext, forgeContext, extContext] + jsonldContext _ = [secContext, forgeContext] parseObject o = do mtyp <- optional $ o .: "@type" <|> o .: "type" for_ mtyp $ \ t -> @@ -438,7 +435,7 @@ data Actor u = Actor } instance ActivityPub Actor where - jsonldContext _ = [as2Context, secContext, forgeContext, extContext] + jsonldContext _ = [as2Context, secContext, forgeContext] parseObject o = do mlocal <- parseActorLocal o (h, local) <- @@ -476,8 +473,8 @@ data TicketTracker u = TicketTracker , ticketTrackerTeam :: LocalURI } -instance ActivityPub Project where - jsonldContext _ = [as2Context, secContext, forgeContext, extContext] +instance ActivityPub TicketTracker where + jsonldContext _ = [as2Context, secContext, forgeContext] parseObject o = do (h, a) <- parseObject o unless (actorType (actorDetail a) == ActorTypeTicketTracker) $ @@ -516,7 +513,7 @@ data Collection a u = Collection } instance (FromJSON a, ToJSON a) => ActivityPub (Collection a) where - jsonldContext _ = [as2Context, forgeContext, extContext] + jsonldContext _ = [as2Context, forgeContext] parseObject o = do ObjURI authority id_ <- o .: "id" fmap (authority,) $ @@ -574,7 +571,7 @@ data CollectionPage a u = CollectionPage } instance (FromJSON a, ToJSON a) => ActivityPub (CollectionPage a) where - jsonldContext _ = [as2Context, forgeContext, extContext] + jsonldContext _ = [as2Context, forgeContext] parseObject o = do PageURI authority id_ <- o .: "id" fmap (authority,) $ @@ -610,7 +607,7 @@ instance (FromJSON a, ToJSON a) => ActivityPub (CollectionPage a) where data Recipient u = RecipientActor (Actor u) | RecipientCollection (Collection (ObjURI u) u) instance ActivityPub Recipient where - jsonldContext _ = [as2Context, secContext, forgeContext, extContext] + jsonldContext _ = [as2Context, secContext, forgeContext] parseObject o = second RecipientActor <$> parseObject o <|> second RecipientCollection <$> parseObject o @@ -736,7 +733,7 @@ withAuthorityMaybeP a m = do else fail "URI authority mismatch" instance ActivityPub Note where - jsonldContext _ = [as2Context, extContext] + jsonldContext _ = [as2Context] parseObject o = do typ <- o .: "type" unless (typ == ("Note" :: Text)) $ @@ -1130,7 +1127,7 @@ data Ticket u = Ticket } instance ActivityPub Ticket where - jsonldContext _ = [as2Context, forgeContext, extContext] + jsonldContext _ = [as2Context, forgeContext] parseObject o = do typ <- o .: "type" unless (typ == ("Ticket" :: Text)) $ @@ -1260,7 +1257,7 @@ data Commit u = Commit } instance ActivityPub Commit where - jsonldContext _ = [as2Context, forgeContext, extContext] + jsonldContext _ = [as2Context, forgeContext] parseObject o = do typ <- o .: "type" unless (typ == ("Commit" :: Text)) $ @@ -1587,7 +1584,7 @@ data Activity u = Activity } instance ActivityPub Activity where - jsonldContext _ = [as2Context, forgeContext, extContext] + jsonldContext _ = [as2Context, forgeContext] parseObject o = do ObjURI a actor <- o .: "actor" fmap (a,) $