interaction

package
v0.17.0-rc5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 14, 2024 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Filter

type Filter struct {
	// contains filtered or unexported fields
}

Filter packages up logic for checking whether an interaction is permitted within set policies.

func NewFilter

func NewFilter(state *state.State) *Filter

NewFilter returns a new Filter that will use the provided state.

func (*Filter) StatusBoostable

func (f *Filter) StatusBoostable(
	ctx context.Context,
	requester *gtsmodel.Account,
	status *gtsmodel.Status,
) (*gtsmodel.PolicyCheckResult, error)

StatusBoostable checks if the given status is boostable by the requester account.

Callers to this function should have already checked the visibility of status to requester, including taking account of blocks, as this function does not do visibility checks, only interaction policy checks.

func (*Filter) StatusLikeable

func (f *Filter) StatusLikeable(
	ctx context.Context,
	requester *gtsmodel.Account,
	status *gtsmodel.Status,
) (*gtsmodel.PolicyCheckResult, error)

StatusLikeable checks if the given status is likeable by the requester account.

Callers to this function should have already checked the visibility of status to requester, including taking account of blocks, as this function does not do visibility checks, only interaction policy checks.

func (*Filter) StatusReplyable

func (f *Filter) StatusReplyable(
	ctx context.Context,
	requester *gtsmodel.Account,
	status *gtsmodel.Status,
) (*gtsmodel.PolicyCheckResult, error)

StatusReplyable checks if the given status is replyable by the requester account.

Callers to this function should have already checked the visibility of status to requester, including taking account of blocks, as this function does not do visibility checks, only interaction policy checks.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL