diff options
Diffstat (limited to 'internal/processing/status')
| -rw-r--r-- | internal/processing/status/boost.go | 11 | ||||
| -rw-r--r-- | internal/processing/status/create.go | 11 | ||||
| -rw-r--r-- | internal/processing/status/fave.go | 21 | 
3 files changed, 38 insertions, 5 deletions
| diff --git a/internal/processing/status/boost.go b/internal/processing/status/boost.go index d6a0c2457..1b6e8bd47 100644 --- a/internal/processing/status/boost.go +++ b/internal/processing/status/boost.go @@ -104,9 +104,18 @@ func (p *Processor) BoostCreate(  		// We're permitted to do this, but since  		// we matched due to presence in a followers  		// or following collection, we should mark -		// as pending approval and wait for an accept. +		// as pending approval and wait until we can +		// prove it's been Accepted by the target.  		pendingApproval = true +		if *target.Local { +			// If the target is local we don't need +			// to wait for an Accept from remote, +			// we can just preapprove it and have +			// the processor create the Accept. +			boost.PreApproved = true +		} +  	case policyResult.Permitted():  		// We're permitted to do this  		// based on another kind of match. diff --git a/internal/processing/status/create.go b/internal/processing/status/create.go index 10e19ac43..11dece87d 100644 --- a/internal/processing/status/create.go +++ b/internal/processing/status/create.go @@ -221,9 +221,18 @@ func (p *Processor) processInReplyTo(ctx context.Context, requester *gtsmodel.Ac  		// We're permitted to do this, but since  		// we matched due to presence in a followers  		// or following collection, we should mark -		// as pending approval and wait for an accept. +		// as pending approval and wait until we can +		// prove it's been Accepted by the target.  		pendingApproval = true +		if *inReplyTo.Local { +			// If the target is local we don't need +			// to wait for an Accept from remote, +			// we can just preapprove it and have +			// the processor create the Accept. +			status.PreApproved = true +		} +  	case policyResult.Permitted():  		// We're permitted to do this  		// based on another kind of match. diff --git a/internal/processing/status/fave.go b/internal/processing/status/fave.go index 0f5a72b7d..497c4d465 100644 --- a/internal/processing/status/fave.go +++ b/internal/processing/status/fave.go @@ -103,8 +103,13 @@ func (p *Processor) FaveCreate(  		return nil, gtserror.NewErrorForbidden(err, errText)  	} -	// Derive pendingApproval status. -	var pendingApproval bool +	// Derive pendingApproval +	// and preapproved status. +	var ( +		pendingApproval bool +		preApproved     bool +	) +  	switch {  	case policyResult.WithApproval():  		// We're allowed to do @@ -115,9 +120,18 @@ func (p *Processor) FaveCreate(  		// We're permitted to do this, but since  		// we matched due to presence in a followers  		// or following collection, we should mark -		// as pending approval and wait for an accept. +		// as pending approval and wait until we can +		// prove it's been Accepted by the target.  		pendingApproval = true +		if *status.Local { +			// If the target is local we don't need +			// to wait for an Accept from remote, +			// we can just preapprove it and have +			// the processor create the Accept. +			preApproved = true +		} +  	case policyResult.Permitted():  		// We're permitted to do this  		// based on another kind of match. @@ -138,6 +152,7 @@ func (p *Processor) FaveCreate(  		StatusID:        status.ID,  		Status:          status,  		URI:             uris.GenerateURIForLike(requester.Username, faveID), +		PreApproved:     preApproved,  		PendingApproval: &pendingApproval,  	} | 
