From 0673ed0bb4a5a191ce53a980df91a591d9f885a4 Mon Sep 17 00:00:00 2001 From: fr33domlover Date: Tue, 22 Oct 2019 10:25:33 +0000 Subject: [PATCH] DB: Remove the "manual" fields from follow records Follows used to be added automatically, without a Follow activity sent by the client. They aren't added automatically anymore, so there's no need for those "manual" boolean fields. --- config/models | 2 -- src/Vervis/API.hs | 2 +- src/Vervis/Federation/Offer.hs | 2 +- src/Vervis/Migration.hs | 4 ++++ 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/config/models b/config/models index 5a5238e..c1c03c2 100644 --- a/config/models +++ b/config/models @@ -176,7 +176,6 @@ FollowerSet Follow person PersonId target FollowerSetId - manual Bool public Bool follow OutboxItemId accept OutboxItemId @@ -188,7 +187,6 @@ Follow RemoteFollow actor RemoteActorId target FollowerSetId - manual Bool public Bool follow RemoteActivityId accept OutboxItemId diff --git a/src/Vervis/API.hs b/src/Vervis/API.hs index 6575ac7..579ba85 100644 --- a/src/Vervis/API.hs +++ b/src/Vervis/API.hs @@ -576,7 +576,7 @@ followC shrUser summary audience follow@(AP.Follow uObject muContext hide) = run return (obiid, doc, luAct) deliverFollowLocal pidAuthor fsid unread obiidF obiidA ibidRecip = do - insert_ $ Follow pidAuthor fsid True (not hide) obiidF obiidA + insert_ $ Follow pidAuthor fsid (not hide) obiidF obiidA ibiid <- insert $ InboxItem unread insert_ $ InboxItemLocal ibidRecip obiidF ibiid diff --git a/src/Vervis/Federation/Offer.hs b/src/Vervis/Federation/Offer.hs index 7c8e3f0..68d1294 100644 --- a/src/Vervis/Federation/Offer.hs +++ b/src/Vervis/Federation/Offer.hs @@ -283,7 +283,7 @@ followF insertFollow ractid obiidA fsid = do let raid = remoteAuthorId author - mrfid <- insertUnique $ RemoteFollow raid fsid True (not hide) ractid obiidA + mrfid <- insertUnique $ RemoteFollow raid fsid (not hide) ractid obiidA return $ isJust mrfid insertAcceptToOutbox ra luFollow obidRecip = do diff --git a/src/Vervis/Migration.hs b/src/Vervis/Migration.hs index cbb9bff..01095aa 100644 --- a/src/Vervis/Migration.hs +++ b/src/Vervis/Migration.hs @@ -1087,6 +1087,10 @@ changes hLocal ctx = , addFieldRefRequiredEmpty "RemoteFollow" "accept" "OutboxItem" -- 148 , addUnique "RemoteFollow" $ Unique "UniqueRemoteFollowAccept" ["accept"] + -- 149 + , removeField "Follow" "manual" + -- 150 + , removeField "RemoteFollow" "manual" ] migrateDB