mirror of
https://code.sup39.dev/repos/Wqawg
synced 2024-12-28 23:04:52 +09:00
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
|
objRoute
|
||||||
(SharerR shr)
|
(SharerR shr)
|
||||||
getRecip
|
getRecip
|
||||||
personInbox
|
(personInbox . fst)
|
||||||
personOutbox
|
(personOutbox . fst)
|
||||||
personFollowers
|
followers
|
||||||
(SharerOutboxItemR shr)
|
(SharerOutboxItemR shr)
|
||||||
where
|
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
|
objRoute _ = Nothing
|
||||||
|
|
||||||
getRecip () = do
|
getRecip mtalkhid = do
|
||||||
sid <- getKeyBy404 $ UniqueSharer shr
|
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
|
projectFollowF
|
||||||
:: ShrIdent
|
:: ShrIdent
|
||||||
|
|
Loading…
Reference in a new issue