workers

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2025 License: AGPL-3.0 Imports: 38 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,
	common *common.Processor,
	federator *federation.Federator,
	converter *typeutils.Converter,
	visFilter *visibility.Filter,
	emailSender email.Sender,
	webPushSender webpush.Sender,
	account *account.Processor,
	media *media.Processor,
	stream *stream.Processor,
	conversations *conversations.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
	VisFilter     *visibility.Filter
	EmailSender   email.Sender
	WebPushSender webpush.Sender
	Conversations *conversations.Processor
}

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