Web.ActivityPub: Remove fake extContext, the URI doesn't work anymore anyway
This commit is contained in:
parent
e2591734d3
commit
3cda2205c5
1 changed files with 12 additions and 15 deletions
|
@ -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,) $
|
||||
|
|
Loading…
Reference in a new issue