diff --git a/src/Vervis/Federation/Offer.hs b/src/Vervis/Federation/Offer.hs index 7da7285..87f8610 100644 --- a/src/Vervis/Federation/Offer.hs +++ b/src/Vervis/Federation/Offer.hs @@ -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