have a local and public timeline *per user*

This commit is contained in:
kim 2025-04-01 15:17:34 +01:00
commit 374f0f5175
3 changed files with 9 additions and 14 deletions

View file

@ -57,8 +57,8 @@ func (p *Processor) publicTimelineGet(
// account.
requester,
// Global public timeline cache.
&p.state.Caches.Timelines.Public,
// Keyed-by-account-ID, public timeline cache.
p.state.Caches.Timelines.Public.MustGet(requester.ID),
// Current
// page.
@ -110,8 +110,8 @@ func (p *Processor) localTimelineGet(
// account.
requester,
// Global local timeline cache.
&p.state.Caches.Timelines.Local,
// Keyed-by-account-ID, local timeline cache.
p.state.Caches.Timelines.Local.MustGet(requester.ID),
// Current
// page.

View file

@ -155,7 +155,7 @@ func (suite *PublicTestSuite) TestPublicTimelineGetHideFiltered() {
}
// Clear the timeline to drop all cached statuses.
suite.state.Caches.Timelines.Public.Clear()
suite.state.Caches.Timelines.Public.ClearAll()
// Create a filter to hide one status on the timeline.
if err := suite.db.PutFilter(ctx, filter); err != nil {

View file

@ -21,7 +21,7 @@ import (
"context"
"errors"
timeline2 "github.com/superseriousbusiness/gotosocial/internal/cache/timeline"
"github.com/superseriousbusiness/gotosocial/internal/cache/timeline"
statusfilter "github.com/superseriousbusiness/gotosocial/internal/filter/status"
"github.com/superseriousbusiness/gotosocial/internal/filter/usermute"
"github.com/superseriousbusiness/gotosocial/internal/gtscontext"
@ -356,16 +356,11 @@ func (s *Surface) listEligible(
}
}
// timelineStatus uses the provided ingest function to put the given
// status in a timeline with the given ID, if it's timelineable.
//
// If the status was inserted into the timeline, true will be returned
// + it will also be streamed to the user using the given streamType.
// timelineStatus ...
// timelineStatus will insert the given status into the given timeline, if it's
// timelineable. if the status was inserted into the timeline, true will be returned.
func (s *Surface) timelineStatus(
ctx context.Context,
timeline *timeline2.StatusTimeline,
timeline *timeline.StatusTimeline,
account *gtsmodel.Account,
status *gtsmodel.Status,
streamType string,