1
0
Fork 0
mirror of https://code.sup39.dev/repos/Wqawg synced 2024-12-27 18:14:52 +09:00

ActivityPub: Add a PatchTracker actor type

This commit is contained in:
fr33domlover 2022-08-15 18:22:46 +00:00
parent 229bc3edf8
commit 87bb369120
2 changed files with 9 additions and 3 deletions

View file

@ -91,7 +91,7 @@ getLoomR loomHash = do
, AP.actorSshKeys = []
}
, AP.actorDetail = AP.ActorDetail
{ AP.actorType = AP.ActorTypeOther "PatchTracker"
{ AP.actorType = AP.ActorTypePatchTracker
, AP.actorUsername = Nothing
, AP.actorName = Just $ actorName actor
, AP.actorSummary = Just $ actorDesc actor

View file

@ -200,8 +200,12 @@ instance (ActivityPub a, UriMode u) => ToJSON (Doc a u) where
context [t] = "@context" .= t
context ts = "@context" .= ts
data ActorType =
ActorTypePerson | ActorTypeRepo | ActorTypeTicketTracker | ActorTypeOther Text
data ActorType
= ActorTypePerson
| ActorTypeRepo
| ActorTypeTicketTracker
| ActorTypePatchTracker
| ActorTypeOther Text
deriving Eq
instance FromJSON ActorType where
@ -211,6 +215,7 @@ instance FromJSON ActorType where
| t == "Person" = ActorTypePerson
| t == "Repository" = ActorTypeRepo
| t == "TicketTracker" = ActorTypeTicketTracker
| t == "PatchTracker" = ActorTypePatchTracker
| otherwise = ActorTypeOther t
instance ToJSON ActorType where
@ -220,6 +225,7 @@ instance ToJSON ActorType where
ActorTypePerson -> "Person"
ActorTypeRepo -> "Repository"
ActorTypeTicketTracker -> "TicketTracker"
ActorTypePatchTracker -> "PatchTracker"
ActorTypeOther t -> t
data Owner = OwnerInstance | OwnerActor LocalURI