summaryrefslogtreecommitdiff
path: root/internal/web/profile.go
diff options
context:
space:
mode:
authorLibravatar kim <grufwub@gmail.com>2025-09-18 16:33:23 +0200
committerLibravatar kim <gruf@noreply.codeberg.org>2025-09-18 16:33:23 +0200
commit6607e1c9444d0814b72762a46814ff0812d96343 (patch)
tree9bbf15038b1a37b01bfcf7010dbe376e70b504d0 /internal/web/profile.go
parent[chore] update dependencies (#4441) (diff)
downloadgotosocial-6607e1c9444d0814b72762a46814ff0812d96343.tar.xz
[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 <zordsdavini@gmail.com> Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4442 Co-authored-by: kim <grufwub@gmail.com> Co-committed-by: kim <grufwub@gmail.com>
Diffstat (limited to 'internal/web/profile.go')
-rw-r--r--internal/web/profile.go13
1 files changed, 7 insertions, 6 deletions
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,
}
}