workers

package
v0.16.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2024 License: AGPL-3.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Processor

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

func New

func New(
	state *state.State,
	federator *federation.Federator,
	converter *typeutils.Converter,
	filter *visibility.Filter,
	emailSender email.Sender,
	account *account.Processor,
	media *media.Processor,
	stream *stream.Processor,
) Processor

func (*Processor) ProcessFromClientAPI

func (p *Processor) ProcessFromClientAPI(ctx context.Context, cMsg *messages.FromClientAPI) error

func (*Processor) ProcessFromFediAPI

func (p *Processor) ProcessFromFediAPI(ctx context.Context, fMsg *messages.FromFediAPI) error

type Surface added in v0.16.0

type Surface struct {
	State       *state.State
	Converter   *typeutils.Converter
	Stream      *stream.Processor
	Filter      *visibility.Filter
	EmailSender email.Sender
}

Surface wraps functions for 'surfacing' the result of processing a message, eg:

  • timelining a status
  • removing a status from timelines
  • sending a notification to a user
  • sending an email

func (*Surface) Notify added in v0.16.0

func (s *Surface) Notify(
	ctx context.Context,
	notificationType gtsmodel.NotificationType,
	targetAccount *gtsmodel.Account,
	originAccount *gtsmodel.Account,
	statusID string,
) error

Notify creates, inserts, and streams a new notification to the target account if it doesn't yet exist with the given parameters.

It filters out non-local target accounts, so it is safe to pass all sorts of notification targets into this function without filtering for non-local first.

targetAccount and originAccount must be set, but statusID can be an empty string.

Jump to

Keyboard shortcuts

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