mirror of
https://code.sup39.dev/repos/Wqawg
synced 2024-12-29 01:54:50 +09:00
ActivityPub: Add a PatchTracker actor type
This commit is contained in:
parent
229bc3edf8
commit
87bb369120
2 changed files with 9 additions and 3 deletions
|
@ -91,7 +91,7 @@ getLoomR loomHash = do
|
||||||
, AP.actorSshKeys = []
|
, AP.actorSshKeys = []
|
||||||
}
|
}
|
||||||
, AP.actorDetail = AP.ActorDetail
|
, AP.actorDetail = AP.ActorDetail
|
||||||
{ AP.actorType = AP.ActorTypeOther "PatchTracker"
|
{ AP.actorType = AP.ActorTypePatchTracker
|
||||||
, AP.actorUsername = Nothing
|
, AP.actorUsername = Nothing
|
||||||
, AP.actorName = Just $ actorName actor
|
, AP.actorName = Just $ actorName actor
|
||||||
, AP.actorSummary = Just $ actorDesc actor
|
, AP.actorSummary = Just $ actorDesc actor
|
||||||
|
|
|
@ -200,8 +200,12 @@ instance (ActivityPub a, UriMode u) => ToJSON (Doc a u) where
|
||||||
context [t] = "@context" .= t
|
context [t] = "@context" .= t
|
||||||
context ts = "@context" .= ts
|
context ts = "@context" .= ts
|
||||||
|
|
||||||
data ActorType =
|
data ActorType
|
||||||
ActorTypePerson | ActorTypeRepo | ActorTypeTicketTracker | ActorTypeOther Text
|
= ActorTypePerson
|
||||||
|
| ActorTypeRepo
|
||||||
|
| ActorTypeTicketTracker
|
||||||
|
| ActorTypePatchTracker
|
||||||
|
| ActorTypeOther Text
|
||||||
deriving Eq
|
deriving Eq
|
||||||
|
|
||||||
instance FromJSON ActorType where
|
instance FromJSON ActorType where
|
||||||
|
@ -211,6 +215,7 @@ instance FromJSON ActorType where
|
||||||
| t == "Person" = ActorTypePerson
|
| t == "Person" = ActorTypePerson
|
||||||
| t == "Repository" = ActorTypeRepo
|
| t == "Repository" = ActorTypeRepo
|
||||||
| t == "TicketTracker" = ActorTypeTicketTracker
|
| t == "TicketTracker" = ActorTypeTicketTracker
|
||||||
|
| t == "PatchTracker" = ActorTypePatchTracker
|
||||||
| otherwise = ActorTypeOther t
|
| otherwise = ActorTypeOther t
|
||||||
|
|
||||||
instance ToJSON ActorType where
|
instance ToJSON ActorType where
|
||||||
|
@ -220,6 +225,7 @@ instance ToJSON ActorType where
|
||||||
ActorTypePerson -> "Person"
|
ActorTypePerson -> "Person"
|
||||||
ActorTypeRepo -> "Repository"
|
ActorTypeRepo -> "Repository"
|
||||||
ActorTypeTicketTracker -> "TicketTracker"
|
ActorTypeTicketTracker -> "TicketTracker"
|
||||||
|
ActorTypePatchTracker -> "PatchTracker"
|
||||||
ActorTypeOther t -> t
|
ActorTypeOther t -> t
|
||||||
|
|
||||||
data Owner = OwnerInstance | OwnerActor LocalURI
|
data Owner = OwnerInstance | OwnerActor LocalURI
|
||||||
|
|
Loading…
Reference in a new issue