From 2509cb83b7c00698a29d53828e9664ce304b08da Mon Sep 17 00:00:00 2001 From: kim Date: Tue, 8 Apr 2025 18:26:57 +0100 Subject: [PATCH] finish writing code comments --- internal/processing/timeline/home.go | 3 ++- internal/processing/timeline/list.go | 3 ++- internal/processing/timeline/public.go | 6 +++++- internal/processing/timeline/tag.go | 3 ++- internal/processing/timeline/timeline.go | 3 +++ 5 files changed, 14 insertions(+), 4 deletions(-) diff --git a/internal/processing/timeline/home.go b/internal/processing/timeline/home.go index eefb45a2a..a2e9e8bc8 100644 --- a/internal/processing/timeline/home.go +++ b/internal/processing/timeline/home.go @@ -28,7 +28,8 @@ import ( "github.com/superseriousbusiness/gotosocial/internal/paging" ) -// HomeTimelineGet ... +// HomeTimelineGet gets a pageable timeline of statuses +// in the home timeline of the requesting account. func (p *Processor) HomeTimelineGet( ctx context.Context, requester *gtsmodel.Account, diff --git a/internal/processing/timeline/list.go b/internal/processing/timeline/list.go index 04166226f..8452e7ba8 100644 --- a/internal/processing/timeline/list.go +++ b/internal/processing/timeline/list.go @@ -30,7 +30,8 @@ import ( "github.com/superseriousbusiness/gotosocial/internal/paging" ) -// ListTimelineGet ... +// ListTimelineGet gets a pageable timeline of statuses +// in the list timeline of ID by the requesting account. func (p *Processor) ListTimelineGet( ctx context.Context, requester *gtsmodel.Account, diff --git a/internal/processing/timeline/public.go b/internal/processing/timeline/public.go index d1c65fc3d..18c738e7c 100644 --- a/internal/processing/timeline/public.go +++ b/internal/processing/timeline/public.go @@ -27,7 +27,11 @@ import ( "github.com/superseriousbusiness/gotosocial/internal/paging" ) -// PublicTimelineGet ... +// PublicTimelineGet gets a pageable timeline of public statuses +// for the given requesting account. It ensures that each status +// in timeline is visible to the account before returning it. +// +// The local argument limits this to local-only statuses. func (p *Processor) PublicTimelineGet( ctx context.Context, requester *gtsmodel.Account, diff --git a/internal/processing/timeline/tag.go b/internal/processing/timeline/tag.go index 995c12285..8169843e1 100644 --- a/internal/processing/timeline/tag.go +++ b/internal/processing/timeline/tag.go @@ -66,7 +66,8 @@ func (p *Processor) TagTimelineGet( // account. requester, - // No cache. + // No + // cache. nil, // Current diff --git a/internal/processing/timeline/timeline.go b/internal/processing/timeline/timeline.go index bb55230ab..7e2b958d1 100644 --- a/internal/processing/timeline/timeline.go +++ b/internal/processing/timeline/timeline.go @@ -110,6 +110,9 @@ func (p *Processor) getStatusTimeline( // Load status page via timeline cache, also // getting lo, hi values for next, prev pages. + // + // NOTE: this safely handles the case of a nil + // input timeline, i.e. uncached timeline type. apiStatuses, lo, hi, err := timeline.Load(ctx, // Status page