mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-30 10:42:25 -05:00
[feature] Rework timeline code to make it useful for more than just statuses (#373)
* add preparable and timelineable interfaces * initialize timeline manager within the processor * generic renaming * move status-specific timeline logic into the processor * refactor timeline to make it useful for more than statuses
This commit is contained in:
parent
98341a1d4d
commit
1b36e85840
26 changed files with 801 additions and 566 deletions
|
|
@ -237,7 +237,7 @@ type processor struct {
|
|||
oauthServer oauth.Server
|
||||
mediaHandler media.Handler
|
||||
storage *kv.KVStore
|
||||
timelineManager timeline.Manager
|
||||
statusTimelines timeline.Manager
|
||||
db db.DB
|
||||
filter visibility.Filter
|
||||
|
||||
|
|
@ -261,7 +261,6 @@ func NewProcessor(
|
|||
oauthServer oauth.Server,
|
||||
mediaHandler media.Handler,
|
||||
storage *kv.KVStore,
|
||||
timelineManager timeline.Manager,
|
||||
db db.DB,
|
||||
emailSender email.Sender) Processor {
|
||||
fromClientAPI := make(chan messages.FromClientAPI, 1000)
|
||||
|
|
@ -274,6 +273,7 @@ func NewProcessor(
|
|||
mediaProcessor := mediaProcessor.New(db, tc, mediaHandler, storage)
|
||||
userProcessor := user.New(db, emailSender)
|
||||
federationProcessor := federationProcessor.New(db, tc, federator, fromFederator)
|
||||
filter := visibility.NewFilter(db)
|
||||
|
||||
return &processor{
|
||||
fromClientAPI: fromClientAPI,
|
||||
|
|
@ -284,7 +284,7 @@ func NewProcessor(
|
|||
oauthServer: oauthServer,
|
||||
mediaHandler: mediaHandler,
|
||||
storage: storage,
|
||||
timelineManager: timelineManager,
|
||||
statusTimelines: timeline.NewManager(StatusGrabFunction(db), StatusFilterFunction(db, filter), StatusPrepareFunction(db, tc), StatusSkipInsertFunction()),
|
||||
db: db,
|
||||
filter: visibility.NewFilter(db),
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue