mirror of
https://code.sup39.dev/repos/Wqawg
synced 2024-12-28 23:54:51 +09:00
C2S: In followC, return friendly message if already following the target object
This commit is contained in:
parent
43cd1a95f3
commit
f296dc173c
1 changed files with 7 additions and 7 deletions
|
@ -774,10 +774,9 @@ followC shrUser summary audience follow@(AP.Follow uObject muContext hide) = run
|
||||||
Nothing -> lift $ insert_ $ FollowRemoteRequest pidAuthor uObject muContext (not hide) obiidFollow
|
Nothing -> lift $ insert_ $ FollowRemoteRequest pidAuthor uObject muContext (not hide) obiidFollow
|
||||||
Just (followee, actorRecip) -> do
|
Just (followee, actorRecip) -> do
|
||||||
(fsid, ibidRecip, unread, obidRecip) <- getFollowee followee
|
(fsid, ibidRecip, unread, obidRecip) <- getFollowee followee
|
||||||
lift $ do
|
obiidAccept <- lift $ insertAcceptToOutbox luFollow actorRecip obidRecip
|
||||||
obiidAccept <- insertAcceptToOutbox luFollow actorRecip obidRecip
|
deliverFollowLocal pidAuthor fsid unread obiidFollow obiidAccept ibidRecip
|
||||||
deliverFollowLocal pidAuthor fsid unread obiidFollow obiidAccept ibidRecip
|
lift $ deliverAcceptLocal obiidAccept ibidAuthor
|
||||||
deliverAcceptLocal obiidAccept ibidAuthor
|
|
||||||
remotesHttp <- lift $ deliverRemoteDB' dont obiidFollow remoteRecips []
|
remotesHttp <- lift $ deliverRemoteDB' dont obiidFollow remoteRecips []
|
||||||
return (obiidFollow, doc, remotesHttp)
|
return (obiidFollow, doc, remotesHttp)
|
||||||
lift $ forkWorker "Outbox POST handler: async HTTP delivery" $ deliverRemoteHttp dont obiidFollow doc remotesHttp
|
lift $ forkWorker "Outbox POST handler: async HTTP delivery" $ deliverRemoteHttp dont obiidFollow doc remotesHttp
|
||||||
|
@ -875,9 +874,10 @@ followC shrUser summary audience follow@(AP.Follow uObject muContext hide) = run
|
||||||
return (obiid, doc, luAct)
|
return (obiid, doc, luAct)
|
||||||
|
|
||||||
deliverFollowLocal pidAuthor fsid unread obiidF obiidA ibidRecip = do
|
deliverFollowLocal pidAuthor fsid unread obiidF obiidA ibidRecip = do
|
||||||
insert_ $ Follow pidAuthor fsid (not hide) obiidF obiidA
|
mfid <- lift $ insertUnique $ Follow pidAuthor fsid (not hide) obiidF obiidA
|
||||||
ibiid <- insert $ InboxItem unread
|
_ <- fromMaybeE mfid "Already following this object"
|
||||||
insert_ $ InboxItemLocal ibidRecip obiidF ibiid
|
ibiid <- lift $ insert $ InboxItem unread
|
||||||
|
lift $ insert_ $ InboxItemLocal ibidRecip obiidF ibiid
|
||||||
|
|
||||||
insertAcceptToOutbox luFollow actorRecip obidRecip = do
|
insertAcceptToOutbox luFollow actorRecip obidRecip = do
|
||||||
now <- liftIO getCurrentTime
|
now <- liftIO getCurrentTime
|
||||||
|
|
Loading…
Reference in a new issue