diff options
| author | 2022-05-02 09:23:37 -0400 | |
|---|---|---|
| committer | 2022-05-02 15:23:37 +0200 | |
| commit | 9265a09a656196e2a94c73e32c7b79399411a79e (patch) | |
| tree | 6cda0aa926f02409f3c3cb4f00c5ef7634b44b53 /internal/processing/status | |
| parent | [chore] Update all but bun libraries (#526) (diff) | |
| download | gotosocial-9265a09a656196e2a94c73e32c7b79399411a79e.tar.xz | |
[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
Diffstat (limited to 'internal/processing/status')
| -rw-r--r-- | internal/processing/status/boost.go | 9 | 
1 files changed, 3 insertions, 6 deletions
| diff --git a/internal/processing/status/boost.go b/internal/processing/status/boost.go index b222544ca..b1abc017c 100644 --- a/internal/processing/status/boost.go +++ b/internal/processing/status/boost.go @@ -39,14 +39,11 @@ func (p *processor) Boost(ctx context.Context, requestingAccount *gtsmodel.Accou  		return nil, gtserror.NewErrorNotFound(fmt.Errorf("no status owner for status %s", targetStatusID))  	} -	visible, err := p.filter.StatusVisible(ctx, targetStatus, requestingAccount) +	boostable, err := p.filter.StatusBoostable(ctx, targetStatus, requestingAccount)  	if err != nil { -		return nil, gtserror.NewErrorNotFound(fmt.Errorf("error seeing if status %s is visible: %s", targetStatus.ID, err)) +		return nil, gtserror.NewErrorNotFound(fmt.Errorf("error seeing if status %s is boostable: %s", targetStatus.ID, err))  	} -	if !visible { -		return nil, gtserror.NewErrorNotFound(errors.New("status is not visible")) -	} -	if !targetStatus.Boostable { +	if !boostable {  		return nil, gtserror.NewErrorForbidden(errors.New("status is not boostable"))  	} | 
