From a548dc8c5b87480adce9d69f1ae2585bd7a96395 Mon Sep 17 00:00:00 2001
From: fr33domlover <fr33domlover@riseup.net>
Date: Wed, 13 May 2020 13:49:22 +0000
Subject: [PATCH] S2S: sharerCreateNoteF: If ctx is sharer-ticket of another
 user, store to inbox

---
 src/Vervis/Federation/Discussion.hs | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/Vervis/Federation/Discussion.hs b/src/Vervis/Federation/Discussion.hs
index 22a097d..a1a92a7 100644
--- a/src/Vervis/Federation/Discussion.hs
+++ b/src/Vervis/Federation/Discussion.hs
@@ -288,7 +288,14 @@ sharerCreateNoteF now shrRecip author body note = do
                                                             ]
                                                 remoteRecips <- insertRemoteActivityToLocalInboxes False ractid $ localRecipSieve' sieve False False localRecips
                                                 (sig,) <$> deliverRemoteDB_S (actbBL body) ractid sid sig remoteRecips
-                    else return $ Left "Context is a sharer-ticket of another sharer"
+                    else do
+                        let did = localTicketDiscuss lt
+                        _ <- traverse (getParent did) mparent
+                        mractid <- lift $ insertToInbox now author body ibid luCreate True
+                        return $ Left $
+                            case mractid of
+                                Nothing -> "Context is a sharer-ticket of another sharer, and I already have this activity in my inbox, doing nothing"
+                                Just _ -> "Context is a sharer-ticket of another sharer, just storing in my inbox"
             case mremotesHttp of
                 Left msg -> return msg
                 Right (sig, remotesHttp) -> do