mirror of
https://code.sup39.dev/repos/Wqawg
synced 2024-12-27 00:54:52 +09:00
S2S: In Undo handler for sharer inbox, support unfollowing sharer tickets
This commit is contained in:
parent
e406b08f44
commit
40a5b336a4
1 changed files with 16 additions and 1 deletions
|
@ -545,11 +545,26 @@ sharerUndoF shr =
|
|||
getRecip
|
||||
personInbox
|
||||
personFollowers
|
||||
(\ _ _ -> return $ Just "Undo object is a RemoteFollow, but isn't under this sharer")
|
||||
tryTicket
|
||||
where
|
||||
getRecip = do
|
||||
sid <- getKeyBy404 $ UniqueSharer shr
|
||||
getBy404 $ UniquePersonIdent sid
|
||||
tryTicket pid fsid = do
|
||||
mltid <- getKeyBy $ UniqueLocalTicketFollowers fsid
|
||||
case mltid of
|
||||
Nothing -> return $ Just "Undo object is a RemoteFollow, but isn't under this sharer"
|
||||
Just ltid -> do
|
||||
mtal <- getBy $ UniqueTicketAuthorLocal ltid
|
||||
case mtal of
|
||||
Just (Entity talid tal)
|
||||
| ticketAuthorLocalAuthor tal == pid -> do
|
||||
mtup <- getBy $ UniqueTicketUnderProjectAuthor talid
|
||||
return $
|
||||
case mtup of
|
||||
Nothing -> Nothing
|
||||
Just _ -> Just "Undo object is a RemoteFollow of a ticket authored by this sharer, but is hosted by the project"
|
||||
_ -> return $ Just "Undo object is a RemoteFollow of a ticket of another author"
|
||||
|
||||
projectUndoF
|
||||
:: ShrIdent
|
||||
|
|
Loading…
Reference in a new issue