Documentation ¶
Index ¶
- func TopoSort(apiStatuses []*apimodel.Status, targetAccountID string)
- type Processor
- func (p *Processor) BookmarkCreate(ctx context.Context, requestingAccount *gtsmodel.Account, ...) (*apimodel.Status, gtserror.WithCode)
- func (p *Processor) BookmarkRemove(ctx context.Context, requestingAccount *gtsmodel.Account, ...) (*apimodel.Status, gtserror.WithCode)
- func (p *Processor) BoostCreate(ctx context.Context, requester *gtsmodel.Account, ...) (*apimodel.Status, gtserror.WithCode)
- func (p *Processor) BoostRemove(ctx context.Context, requester *gtsmodel.Account, ...) (*apimodel.Status, gtserror.WithCode)
- func (p *Processor) ContextGet(ctx context.Context, requestingAccount *gtsmodel.Account, ...) (*apimodel.Context, gtserror.WithCode)
- func (p *Processor) Create(ctx context.Context, requester *gtsmodel.Account, ...) (*apimodel.Status, gtserror.WithCode)
- func (p *Processor) Delete(ctx context.Context, requestingAccount *gtsmodel.Account, ...) (*apimodel.Status, gtserror.WithCode)
- func (p *Processor) FaveCreate(ctx context.Context, requestingAccount *gtsmodel.Account, ...) (*apimodel.Status, gtserror.WithCode)
- func (p *Processor) FaveRemove(ctx context.Context, requestingAccount *gtsmodel.Account, ...) (*apimodel.Status, gtserror.WithCode)
- func (p *Processor) FavedBy(ctx context.Context, requestingAccount *gtsmodel.Account, ...) ([]*apimodel.Account, gtserror.WithCode)
- func (p *Processor) Get(ctx context.Context, requestingAccount *gtsmodel.Account, ...) (*apimodel.Status, gtserror.WithCode)
- func (p *Processor) MuteCreate(ctx context.Context, requestingAccount *gtsmodel.Account, ...) (*apimodel.Status, gtserror.WithCode)
- func (p *Processor) MuteRemove(ctx context.Context, requestingAccount *gtsmodel.Account, ...) (*apimodel.Status, gtserror.WithCode)
- func (p *Processor) PinCreate(ctx context.Context, requestingAccount *gtsmodel.Account, ...) (*apimodel.Status, gtserror.WithCode)
- func (p *Processor) PinRemove(ctx context.Context, requestingAccount *gtsmodel.Account, ...) (*apimodel.Status, gtserror.WithCode)
- func (p *Processor) StatusBoostedBy(ctx context.Context, requestingAccount *gtsmodel.Account, ...) ([]*apimodel.Account, gtserror.WithCode)
- func (p *Processor) WebContextGet(ctx context.Context, targetStatusID string) (*apimodel.Context, gtserror.WithCode)
- func (p *Processor) WebGet(ctx context.Context, targetStatusID string) (*apimodel.Status, gtserror.WithCode)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Processor ¶
type Processor struct {
// contains filtered or unexported fields
}
func New ¶
func New( state *state.State, common *common.Processor, polls *polls.Processor, federator *federation.Federator, converter *typeutils.Converter, filter *visibility.Filter, parseMention gtsmodel.ParseMentionFunc, ) Processor
New returns a new status processor.
func (*Processor) BookmarkCreate ¶ added in v0.8.0
func (p *Processor) BookmarkCreate(ctx context.Context, requestingAccount *gtsmodel.Account, targetStatusID string) (*apimodel.Status, gtserror.WithCode)
BookmarkCreate adds a bookmark for the requestingAccount, targeting the given status (no-op if bookmark already exists).
func (*Processor) BookmarkRemove ¶ added in v0.8.0
func (p *Processor) BookmarkRemove(ctx context.Context, requestingAccount *gtsmodel.Account, targetStatusID string) (*apimodel.Status, gtserror.WithCode)
BookmarkRemove removes a bookmark for the requesting account, targeting the given status (no-op if bookmark doesn't exist).
func (*Processor) BoostCreate ¶ added in v0.8.0
func (p *Processor) BoostCreate( ctx context.Context, requester *gtsmodel.Account, application *gtsmodel.Application, targetID string, ) (*apimodel.Status, gtserror.WithCode)
BoostCreate processes the boost/reblog of target status, returning the newly-created boost.
func (*Processor) BoostRemove ¶ added in v0.8.0
func (p *Processor) BoostRemove( ctx context.Context, requester *gtsmodel.Account, application *gtsmodel.Application, targetID string, ) (*apimodel.Status, gtserror.WithCode)
BoostRemove processes the unboost/unreblog of target status, returning the target status.
func (*Processor) ContextGet ¶ added in v0.8.0
func (p *Processor) ContextGet(ctx context.Context, requestingAccount *gtsmodel.Account, targetStatusID string) (*apimodel.Context, gtserror.WithCode)
ContextGet returns the context (previous and following posts) from the given status ID.
func (*Processor) Create ¶
func (p *Processor) Create( ctx context.Context, requester *gtsmodel.Account, application *gtsmodel.Application, form *apimodel.AdvancedStatusCreateForm, ) ( *apimodel.Status, gtserror.WithCode, )
Create processes the given form to create a new status, returning the api model representation of that status if it's OK.
Precondition: the form's fields should have already been validated and normalized by the caller.
func (*Processor) Delete ¶
func (p *Processor) Delete(ctx context.Context, requestingAccount *gtsmodel.Account, targetStatusID string) (*apimodel.Status, gtserror.WithCode)
Delete processes the delete of a given status, returning the deleted status if the delete goes through.
func (*Processor) FaveCreate ¶ added in v0.8.0
func (p *Processor) FaveCreate(ctx context.Context, requestingAccount *gtsmodel.Account, targetStatusID string) (*apimodel.Status, gtserror.WithCode)
FaveCreate adds a fave for the requestingAccount, targeting the given status (no-op if fave already exists).
func (*Processor) FaveRemove ¶ added in v0.8.0
func (p *Processor) FaveRemove(ctx context.Context, requestingAccount *gtsmodel.Account, targetStatusID string) (*apimodel.Status, gtserror.WithCode)
FaveRemove removes a fave for the requesting account, targeting the given status (no-op if fave doesn't exist).
func (*Processor) FavedBy ¶
func (p *Processor) FavedBy(ctx context.Context, requestingAccount *gtsmodel.Account, targetStatusID string) ([]*apimodel.Account, gtserror.WithCode)
FavedBy returns a slice of accounts that have liked the given status, filtered according to privacy settings.
func (*Processor) Get ¶
func (p *Processor) Get(ctx context.Context, requestingAccount *gtsmodel.Account, targetStatusID string) (*apimodel.Status, gtserror.WithCode)
Get gets the given status, taking account of privacy settings and blocks etc.
func (*Processor) MuteCreate ¶ added in v0.13.0
func (*Processor) MuteRemove ¶ added in v0.13.0
func (*Processor) PinCreate ¶ added in v0.8.0
func (p *Processor) PinCreate(ctx context.Context, requestingAccount *gtsmodel.Account, targetStatusID string) (*apimodel.Status, gtserror.WithCode)
PinCreate pins the target status to the top of requestingAccount's profile, if possible.
Conditions for a pin to work:
- Status belongs to requesting account.
- Status is public, unlisted, or followers-only.
- Status is not a boost.
- Status is not already pinnd.
- Limit of pinned statuses not yet met or exceeded.
If the conditions can't be met, then code 422 Unprocessable Entity will be returned.
func (*Processor) PinRemove ¶ added in v0.8.0
func (p *Processor) PinRemove(ctx context.Context, requestingAccount *gtsmodel.Account, targetStatusID string) (*apimodel.Status, gtserror.WithCode)
PinRemove unpins the target status from the top of requestingAccount's profile, if possible.
Conditions for an unpin to work:
- Status belongs to requesting account.
- Status is public, unlisted, or followers-only.
- Status is not a boost.
If the conditions can't be met, then code 422 Unprocessable Entity will be returned.
Unlike with PinCreate, statuses that are already unpinned will not return 422, but just do nothing and return the api model representation of the status, to conform to the masto API.
func (*Processor) StatusBoostedBy ¶ added in v0.8.0
func (p *Processor) StatusBoostedBy(ctx context.Context, requestingAccount *gtsmodel.Account, targetStatusID string) ([]*apimodel.Account, gtserror.WithCode)
StatusBoostedBy returns a slice of accounts that have boosted the given status, filtered according to privacy settings.
func (*Processor) WebContextGet ¶ added in v0.13.0
func (p *Processor) WebContextGet(ctx context.Context, targetStatusID string) (*apimodel.Context, gtserror.WithCode)
WebContextGet is like ContextGet, but is explicitly for viewing statuses via the unauthenticated web UI.
TODO: a more advanced threading model could be implemented here.