S2S: In Follow handler for sharer inbox, support following of sharer tickets
This commit is contained in:
parent
f4ab99f7bb
commit
e406b08f44
1 changed files with 21 additions and 7 deletions
|
@ -374,17 +374,31 @@ sharerFollowF shr =
|
|||
objRoute
|
||||
(SharerR shr)
|
||||
getRecip
|
||||
personInbox
|
||||
personOutbox
|
||||
personFollowers
|
||||
(personInbox . fst)
|
||||
(personOutbox . fst)
|
||||
followers
|
||||
(SharerOutboxItemR shr)
|
||||
where
|
||||
objRoute (SharerR shr') | shr == shr' = Just ()
|
||||
objRoute (SharerR shr')
|
||||
| shr == shr' = Just Nothing
|
||||
objRoute (SharerTicketR shr' talkhid)
|
||||
| shr == shr' = Just $ Just talkhid
|
||||
objRoute _ = Nothing
|
||||
|
||||
getRecip () = do
|
||||
getRecip mtalkhid = do
|
||||
sid <- getKeyBy404 $ UniqueSharer shr
|
||||
getValBy404 $ UniquePersonIdent sid
|
||||
Entity pid p <- getBy404 $ UniquePersonIdent sid
|
||||
mt <- for mtalkhid $ \ talkhid -> do
|
||||
talid <- decodeKeyHashid404 talkhid
|
||||
tal <- get404 talid
|
||||
unless (ticketAuthorLocalAuthor tal == pid) notFound
|
||||
mtup <- getBy $ UniqueTicketUnderProjectAuthor talid
|
||||
unless (isNothing mtup) notFound
|
||||
getJust $ ticketAuthorLocalTicket tal
|
||||
return (p, mt)
|
||||
|
||||
followers (p, Nothing) = personFollowers p
|
||||
followers (_, Just lt) = localTicketFollowers lt
|
||||
|
||||
projectFollowF
|
||||
:: ShrIdent
|
||||
|
|
Loading…
Reference in a new issue