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

S2S: In Follow handler for sharer inbox, support following of sharer tickets

This commit is contained in:
fr33domlover 2020-04-10 10:34:22 +00:00
parent f4ab99f7bb
commit e406b08f44

View file

@ -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 _ = Nothing
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