mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-18 15:39:20 -06:00
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
This commit is contained in:
parent
2d921d9d7c
commit
86a59db711
5 changed files with 68 additions and 19 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue