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. // account.
requester, requester,
// Global public timeline cache. // Keyed-by-account-ID, public timeline cache.
&p.state.Caches.Timelines.Public, p.state.Caches.Timelines.Public.MustGet(requester.ID),
// Current // Current
// page. // page.
@ -110,8 +110,8 @@ func (p *Processor) localTimelineGet(
// account. // account.
requester, requester,
// Global local timeline cache. // Keyed-by-account-ID, local timeline cache.
&p.state.Caches.Timelines.Local, p.state.Caches.Timelines.Local.MustGet(requester.ID),
// Current // Current
// page. // page.

View file

@ -155,7 +155,7 @@ func (suite *PublicTestSuite) TestPublicTimelineGetHideFiltered() {
} }
// Clear the timeline to drop all cached statuses. // 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. // Create a filter to hide one status on the timeline.
if err := suite.db.PutFilter(ctx, filter); err != nil { if err := suite.db.PutFilter(ctx, filter); err != nil {

View file

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