S2S: Person: Trivial Resolve handler
This commit is contained in:
parent
35eb4917a1
commit
222ba823c1
1 changed files with 27 additions and 0 deletions
|
@ -112,6 +112,32 @@ personOffer now recipPersonID (Verse authorIdMsig body) (AP.Offer object uTarget
|
|||
Nothing -> done "I already have this activity in my inbox"
|
||||
Just _actorID -> done "Inserted this Offer to my inbox"
|
||||
|
||||
-- Meaning: Someone has asked to resolve a ticket/MR
|
||||
-- Behavior:
|
||||
-- * Insert to my inbox
|
||||
personResolve
|
||||
:: UTCTime
|
||||
-> PersonId
|
||||
-> Verse
|
||||
-> AP.Resolve URIMode
|
||||
-> ActE (Text, Act (), Next)
|
||||
personResolve now recipPersonID (Verse authorIdMsig body) (AP.Resolve uObject) = do
|
||||
|
||||
maybeNew <- withDBExcept $ do
|
||||
|
||||
-- Grab me from DB
|
||||
(personRecip, actorRecip) <- lift $ do
|
||||
p <- getJust recipPersonID
|
||||
(p,) <$> getJust (personActor p)
|
||||
|
||||
maybeResolveDB <- lift $ insertToInbox now authorIdMsig body (actorInbox actorRecip) True
|
||||
for maybeResolveDB $ \ _resolveDB ->
|
||||
return $ personActor personRecip
|
||||
|
||||
case maybeNew of
|
||||
Nothing -> done "I already have this activity in my inbox"
|
||||
Just _actorID -> done "Inserted this Resolve to my inbox"
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
-- Following
|
||||
------------------------------------------------------------------------------
|
||||
|
@ -725,6 +751,7 @@ personBehavior now personID (Left verse@(Verse _authorIdMsig body)) =
|
|||
AP.OfferActivity offer -> personOffer now personID verse offer
|
||||
AP.RejectActivity reject -> personReject now personID verse reject
|
||||
AP.RemoveActivity remove -> personRemove now personID verse remove
|
||||
AP.ResolveActivity resolve -> personResolve now personID verse resolve
|
||||
AP.RevokeActivity revoke -> personRevoke now personID verse revoke
|
||||
AP.UndoActivity undo -> personUndo now personID verse undo
|
||||
_ -> throwE "Unsupported activity type for Person"
|
||||
|
|
Loading…
Reference in a new issue