1
0
Fork 0
mirror of https://code.naskya.net/repos/ndqEd synced 2025-03-20 15:14:54 +09:00

S2S: Prepare Offer/Ticket parsing code for handling a remote patch/MR

This commit is contained in:
fr33domlover 2020-07-15 13:00:58 +00:00
parent c78becaf5e
commit 6d4d77255f
3 changed files with 83 additions and 14 deletions

View file

@ -875,7 +875,7 @@ encodePatchLocal a (PatchLocal id_ context versions)
data Patch u = Patch
{ patchLocal :: Maybe (Authority u, PatchLocal)
, patchAttributedTo :: LocalURI
, patchPublished :: UTCTime
, patchPublished :: Maybe UTCTime
, patchType :: PatchType
, patchContent :: Text
}
@ -894,7 +894,7 @@ instance ActivityPub Patch where
Patch
<$> parsePatchLocal o
<*> pure attrib
<*> o .: "published"
<*> o .:? "published"
<*> o .: "mediaType"
<*> o .: "content"
@ -902,7 +902,7 @@ instance ActivityPub Patch where
= maybe mempty (uncurry encodePatchLocal) local
<> "type" .= ("Patch" :: Text)
<> "attributedTo" .= ObjURI a attrib
<> "published" .= published
<> "published" .=? published
<> "mediaType" .= typ
<> "content" .= content