mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02: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:
@ -413,7 +413,7 @@ func (p *processor) timelineStatusForAccount(ctx context.Context, status *gtsmod
|
||||
}
|
||||
|
||||
// stick the status in the timeline for the account and then immediately prepare it so they can see it right away
|
||||
inserted, err := p.timelineManager.IngestAndPrepare(ctx, status, timelineAccount.ID)
|
||||
inserted, err := p.statusTimelines.IngestAndPrepare(ctx, status, timelineAccount.ID)
|
||||
if err != nil {
|
||||
errors <- fmt.Errorf("timelineStatusForAccount: error ingesting status %s: %s", status.ID, err)
|
||||
return
|
||||
@ -436,7 +436,7 @@ func (p *processor) timelineStatusForAccount(ctx context.Context, status *gtsmod
|
||||
// deleteStatusFromTimelines completely removes the given status from all timelines.
|
||||
// It will also stream deletion of the status to all open streams.
|
||||
func (p *processor) deleteStatusFromTimelines(ctx context.Context, status *gtsmodel.Status) error {
|
||||
if err := p.timelineManager.WipeStatusFromAllTimelines(ctx, status.ID); err != nil {
|
||||
if err := p.statusTimelines.WipeItemFromAllTimelines(ctx, status.ID); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user