From 6f6e89e2715c9ecbadda6b8dbe5227995348dae8 Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Wed, 8 Jun 2022 20:22:49 +0200 Subject: [feature] Add paging via `Link` header for notifications and account statuses (#629) * test link headers * page get account statuses properly * page get notifications * add util func for packaging timeline responses * return timelined stuff from accountstatusesget * rename timeline response * use new convenience function * go fmt --- internal/api/model/timeline.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'internal/api/model/timeline.go') diff --git a/internal/api/model/timeline.go b/internal/api/model/timeline.go index 66a5263b8..71d839ed2 100644 --- a/internal/api/model/timeline.go +++ b/internal/api/model/timeline.go @@ -18,9 +18,11 @@ package model -// StatusTimelineResponse wraps a slice of statuses, ready to be serialized, along with the Link +import "github.com/superseriousbusiness/gotosocial/internal/timeline" + +// TimelineResponse wraps a slice of timelineables, ready to be serialized, along with the Link // header for the previous and next queries, to be returned to the client. -type StatusTimelineResponse struct { - Statuses []*Status +type TimelineResponse struct { + Items []timeline.Timelineable LinkHeader string } -- cgit v1.2.3