From 86a59db711fa893362cfccdee3cd4a08e16ccdb5 Mon Sep 17 00:00:00 2001 From: Vyr Cossont Date: Tue, 23 Jul 2024 12:51:57 -0700 Subject: Remove content and related fields from boosts (#3131) These duplicate the content of the target and aren't necessary for anything. - Stops copying some fields from target when boosting or processing a remote boost - Adds a migration to null out existing duplicate data - Updates tests --- internal/federation/dereferencing/announce.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'internal/federation') diff --git a/internal/federation/dereferencing/announce.go b/internal/federation/dereferencing/announce.go index 51f1ffcdd..d786d0695 100644 --- a/internal/federation/dereferencing/announce.go +++ b/internal/federation/dereferencing/announce.go @@ -26,6 +26,7 @@ import ( "github.com/superseriousbusiness/gotosocial/internal/gtserror" "github.com/superseriousbusiness/gotosocial/internal/gtsmodel" "github.com/superseriousbusiness/gotosocial/internal/id" + "github.com/superseriousbusiness/gotosocial/internal/util" ) // EnrichAnnounce enriches the given boost wrapper status @@ -78,14 +79,12 @@ func (d *Dereferencer) EnrichAnnounce( // original URI was an indirect link. boost.BoostOfURI = target.URI + // Boosts are not considered sensitive even if their target is. + boost.Sensitive = util.Ptr(false) + // Populate remaining fields on // the boost wrapper using target. - boost.Content = target.Content - boost.ContentWarning = target.ContentWarning boost.ActivityStreamsType = target.ActivityStreamsType - boost.Sensitive = target.Sensitive - boost.Language = target.Language - boost.Text = target.Text boost.BoostOfID = target.ID boost.BoostOf = target boost.BoostOfAccountID = target.AccountID -- cgit v1.2.3