summaryrefslogtreecommitdiff
path: root/internal/federation
diff options
context:
space:
mode:
authorLibravatar Vyr Cossont <VyrCossont@users.noreply.github.com>2024-07-23 12:51:57 -0700
committerLibravatar GitHub <noreply@github.com>2024-07-23 20:51:57 +0100
commit86a59db711fa893362cfccdee3cd4a08e16ccdb5 (patch)
treeedb20305ed755d70ebb0eb198057416eb18f8d78 /internal/federation
parentExplicitly propagate filter results from statuses to their boosts in API resp... (diff)
downloadgotosocial-86a59db711fa893362cfccdee3cd4a08e16ccdb5.tar.xz
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
Diffstat (limited to 'internal/federation')
-rw-r--r--internal/federation/dereferencing/announce.go9
1 files changed, 4 insertions, 5 deletions
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