From 6607e1c9444d0814b72762a46814ff0812d96343 Mon Sep 17 00:00:00 2001 From: kim Date: Thu, 18 Sep 2025 16:33:23 +0200 Subject: [feature] add paging support to rss feed endpoint, and support JSON / atom feed types (#4442) originally based on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4396 hope this is okay https://codeberg.org/zordsdavini ! closes https://codeberg.org/superseriousbusiness/gotosocial/issues/4411 closes https://codeberg.org/superseriousbusiness/gotosocial/issues/3407 Co-authored-by: Arnas Udovic Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4442 Co-authored-by: kim Co-committed-by: kim --- internal/web/profile.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'internal/web/profile.go') diff --git a/internal/web/profile.go b/internal/web/profile.go index 98abe5741..458557b8b 100644 --- a/internal/web/profile.go +++ b/internal/web/profile.go @@ -27,6 +27,7 @@ import ( apiutil "code.superseriousbusiness.org/gotosocial/internal/api/util" "code.superseriousbusiness.org/gotosocial/internal/gtserror" "code.superseriousbusiness.org/gotosocial/internal/log" + "code.superseriousbusiness.org/gotosocial/internal/paging" "github.com/gin-gonic/gin" ) @@ -122,14 +123,15 @@ func (m *Module) prepareProfile(c *gin.Context) *profile { // Check if paging. maxStatusID := apiutil.ParseMaxID(c.Query(apiutil.MaxIDKey), "") - paging := maxStatusID != "" + doPaging := (maxStatusID != "") - // If not paging, load pinned statuses. var ( mediaOnly = account.WebLayout == "gallery" pinnedStatuses []*apimodel.WebStatus ) - if !paging { + + if !doPaging { + // If not paging, load pinned statuses. var errWithCode gtserror.WithCode pinnedStatuses, errWithCode = m.processor.Account().WebStatusesGetPinned( ctx, @@ -156,9 +158,8 @@ func (m *Module) prepareProfile(c *gin.Context) *profile { statusResp, errWithCode := m.processor.Account().WebStatusesGet( ctx, account.ID, + &paging.Page{Max: paging.MaxID(maxStatusID), Limit: limit}, mediaOnly, - limit, - maxStatusID, ) if errWithCode != nil { apiutil.WebErrorHandler(c, errWithCode, instanceGet) @@ -172,7 +173,7 @@ func (m *Module) prepareProfile(c *gin.Context) *profile { robotsMeta: robotsMeta, pinnedStatuses: pinnedStatuses, statusResp: statusResp, - paging: paging, + paging: doPaging, } } -- cgit v1.2.3