summaryrefslogtreecommitdiff
path: root/internal/processing/processor.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2023-05-25 10:37:38 +0200
committerLibravatar GitHub <noreply@github.com>2023-05-25 10:37:38 +0200
commitf5c004d67d4ed66b6c6df100afec47174aa14ae0 (patch)
tree45b72a6e90450d711e10571d844138186fe023c9 /internal/processing/processor.go
parent[docs] local docs hacking howto (#1816) (diff)
downloadgotosocial-f5c004d67d4ed66b6c6df100afec47174aa14ae0.tar.xz
[feature] Add List functionality (#1802)
* start working on lists * further list work * test list db functions nicely * more work on lists * peepoopeepoo * poke * start list timeline func * we're getting there lads * couldn't be me working on stuff... could it? * hook up handlers * fiddling * weeee * woah * screaming, pissing * fix streaming being a whiny baby * lint, small test fix, swagger * tidying up, testing * fucked! by the linter * move timelines to state like a boss * add timeline start to tests using state * invalidate lists
Diffstat (limited to 'internal/processing/processor.go')
-rw-r--r--internal/processing/processor.go70
1 files changed, 33 insertions, 37 deletions
diff --git a/internal/processing/processor.go b/internal/processing/processor.go
index 749987d6a..d5f88bfb2 100644
--- a/internal/processing/processor.go
+++ b/internal/processing/processor.go
@@ -29,39 +29,41 @@ import (
"github.com/superseriousbusiness/gotosocial/internal/processing/account"
"github.com/superseriousbusiness/gotosocial/internal/processing/admin"
"github.com/superseriousbusiness/gotosocial/internal/processing/fedi"
+ "github.com/superseriousbusiness/gotosocial/internal/processing/list"
"github.com/superseriousbusiness/gotosocial/internal/processing/media"
"github.com/superseriousbusiness/gotosocial/internal/processing/report"
"github.com/superseriousbusiness/gotosocial/internal/processing/status"
"github.com/superseriousbusiness/gotosocial/internal/processing/stream"
+ "github.com/superseriousbusiness/gotosocial/internal/processing/timeline"
"github.com/superseriousbusiness/gotosocial/internal/processing/user"
"github.com/superseriousbusiness/gotosocial/internal/state"
- "github.com/superseriousbusiness/gotosocial/internal/timeline"
"github.com/superseriousbusiness/gotosocial/internal/typeutils"
"github.com/superseriousbusiness/gotosocial/internal/visibility"
)
type Processor struct {
- federator federation.Federator
- tc typeutils.TypeConverter
- oauthServer oauth.Server
- mediaManager mm.Manager
- statusTimelines timeline.Manager
- state *state.State
- emailSender email.Sender
- filter *visibility.Filter
+ federator federation.Federator
+ tc typeutils.TypeConverter
+ oauthServer oauth.Server
+ mediaManager mm.Manager
+ state *state.State
+ emailSender email.Sender
+ filter *visibility.Filter
/*
SUB-PROCESSORS
*/
- account account.Processor
- admin admin.Processor
- fedi fedi.Processor
- media media.Processor
- report report.Processor
- status status.Processor
- stream stream.Processor
- user user.Processor
+ account account.Processor
+ admin admin.Processor
+ fedi fedi.Processor
+ list list.Processor
+ media media.Processor
+ report report.Processor
+ status status.Processor
+ stream stream.Processor
+ timeline timeline.Processor
+ user user.Processor
}
func (p *Processor) Account() *account.Processor {
@@ -76,6 +78,10 @@ func (p *Processor) Fedi() *fedi.Processor {
return &p.fedi
}
+func (p *Processor) List() *list.Processor {
+ return &p.list
+}
+
func (p *Processor) Media() *media.Processor {
return &p.media
}
@@ -92,6 +98,10 @@ func (p *Processor) Stream() *stream.Processor {
return &p.stream
}
+func (p *Processor) Timeline() *timeline.Processor {
+ return &p.timeline
+}
+
func (p *Processor) User() *user.Processor {
return &p.user
}
@@ -114,23 +124,19 @@ func NewProcessor(
tc: tc,
oauthServer: oauthServer,
mediaManager: mediaManager,
- statusTimelines: timeline.NewManager(
- StatusGrabFunction(state.DB),
- StatusFilterFunction(state.DB, filter),
- StatusPrepareFunction(state.DB, tc),
- StatusSkipInsertFunction(),
- ),
- state: state,
- filter: filter,
- emailSender: emailSender,
+ state: state,
+ filter: filter,
+ emailSender: emailSender,
}
- // sub processors
+ // Instantiate sub processors.
processor.account = account.New(state, tc, mediaManager, oauthServer, federator, filter, parseMentionFunc)
processor.admin = admin.New(state, tc, mediaManager, federator.TransportController(), emailSender)
processor.fedi = fedi.New(state, tc, federator, filter)
+ processor.list = list.New(state, tc)
processor.media = media.New(state, tc, mediaManager, federator.TransportController())
processor.report = report.New(state, tc)
+ processor.timeline = timeline.New(state, tc, filter)
processor.status = status.New(state, federator, tc, filter, parseMentionFunc)
processor.stream = stream.New(state, oauthServer)
processor.user = user.New(state, emailSender)
@@ -161,13 +167,3 @@ func (p *Processor) EnqueueFederator(ctx context.Context, msgs ...messages.FromF
}
})
}
-
-// Start starts the Processor.
-func (p *Processor) Start() error {
- return p.statusTimelines.Start()
-}
-
-// Stop stops the processor cleanly.
-func (p *Processor) Stop() error {
- return p.statusTimelines.Stop()
-}