diff --git a/src/Vervis/Federation.hs b/src/Vervis/Federation.hs index ed61372..a2b510c 100644 --- a/src/Vervis/Federation.hs +++ b/src/Vervis/Federation.hs @@ -417,6 +417,9 @@ handleOutboxNote host (Note mluNote luAttrib aud muParent muContext mpublished c uContext <- fromMaybeE muContext "Note without context" recips <- nonEmptyE (concatRecipients aud) "Note without recipients" (mparent, localRecips, mticket, remoteRecips) <- parseRecipsContextParent recips uContext muParent + federation <- getsYesod $ appFederation . appSettings + unless (federation || null remoteRecips) $ + throwE "Federation disabled, but remote recipients specified" result <- lift $ try $ runDB $ (either abort return =<<) . runExceptT $ do (pid, shrUser) <- verifyIsLoggedInUser luAttrib "Note attributed to different actor" (did, meparent, mcollections) <- case mticket of @@ -479,6 +482,8 @@ handleOutboxNote host (Note mluNote luAttrib aud muParent muContext mpublished c return (did, meparent, Nothing) (lmid, obid, doc) <- lift $ insertMessage luAttrib shrUser pid uContext did muParent meparent content moreRemotes <- deliverLocal obid localRecips mcollections + unless (federation || null moreRemotes) $ + throwE "Federation disabled but remote collection members found" remotesHttp <- lift $ deliverRemoteDB obid remoteRecips moreRemotes return (lmid, obid, doc, remotesHttp) (lmid, obid, doc, remotesHttp) <- case result of