From 9265a09a656196e2a94c73e32c7b79399411a79e Mon Sep 17 00:00:00 2001 From: Adelie Paull <1208865+i-am-a-paull@users.noreply.github.com> Date: Mon, 2 May 2022 09:23:37 -0400 Subject: [bugfix] Allow self-boosting for any visibility but direct (#510) * create visibility filter for boostability and allow self-boosting for any visbility but direct messages * add a followers-only status to local_account_2 * fix typo in comment * add license header, unwrap errors, be explicit about non-boostable visibility settings to avoid rogue boosting from miscoded clients, use ID compare for checking if self-boosting * add tests for statusboostable filter * fix tests that were affected by adding a new status to the test data * fix the rest of tests affected by adding a status to the textrig data --- testrig/testmodels.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'testrig') diff --git a/testrig/testmodels.go b/testrig/testmodels.go index 949bfa7bf..cc32aa39e 100644 --- a/testrig/testmodels.go +++ b/testrig/testmodels.go @@ -1263,6 +1263,30 @@ func NewTestStatuses() map[string]*gtsmodel.Status { Likeable: true, ActivityStreamsType: ap.ObjectNote, }, + "local_account_2_status_7": { + ID: "01G20ZM733MGN8J344T4ZDDFY1", + URI: "http://localhost:8080/users/1happyturtle/statuses/01G20ZM733MGN8J344T4ZDDFY1", + URL: "http://localhost:8080/@1happyturtle/statuses/01G20ZM733MGN8J344T4ZDDFY1", + Content: "🐢 hi followers! did u know i'm a turtle? 🐢", + AttachmentIDs: []string{}, + CreatedAt: time.Now().Add(-1 * time.Minute), + UpdatedAt: time.Now().Add(-1 * time.Minute), + Local: true, + AccountURI: "http://localhost:8080/users/1happyturtle", + AccountID: "01F8MH5NBDF2MV7CTC4Q5128HF", + InReplyToID: "", + BoostOfID: "", + ContentWarning: "", + Visibility: gtsmodel.VisibilityFollowersOnly, + Sensitive: false, + Language: "en", + CreatedWithApplicationID: "01F8MGYG9E893WRHW0TAEXR8GJ", + Federated: true, + Boostable: true, + Replyable: true, + Likeable: true, + ActivityStreamsType: ap.ObjectNote, + }, "remote_account_1_status_1": { ID: "01FVW7JHQFSFK166WWKR8CBA6M", URI: "http://fossbros-anonymous.io/users/foss_satan/statuses/01FVW7JHQFSFK166WWKR8CBA6M", -- cgit v1.3