-
-
Notifications
You must be signed in to change notification settings - Fork 298
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[feature] Client API endpoints + v. basic web view for pinned posts #1547
Conversation
934ab7d
to
536b656
Compare
Some questions about implementation details so far, but otherwise looking generally good. Once we've finished talking through these I'll finish reviewing :) |
@@ -125,7 +139,8 @@ func (m *Module) profileGETHandler(c *gin.Context) { | |||
"robotsMeta": robotsMeta, | |||
"statuses": statusResp.Items, | |||
"statuses_next": statusResp.NextLink, | |||
"show_back_to_top": showBackToTop, | |||
"pinned_statuses": pinnedResp.Items, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Surely this will panic if !paging, i.e. pinnedResp == nil. Would it be better to instead do var pinnedItems []any
and set these within the !paging
clause i.e. pinnedItem = pinnedResp
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait just realized that item is always allocated. But this way might be a lil' neater anywho 😇
2 final questions regarding expected behaviour just to double check this is expected behaviour that will work with existing clients. And one tiny nitpick. But otherwise the code looks really good and once you have addressed those feel free to merge this :) |
Description
This pull request implements client API endpoints to allow users to pin + unpin toots (maximum 10, currently), and to allow API callers to view pinned toots when getting an account's statuses.
It also makes some minor changes to our html templates and css to show a basic view of pinned toots at the top of a profile in the web view.
This PR does not yet include logic for federating pinned posts in and out of GoToSocial, that will be in a separate PR.
closes #947
Checklist
Please put an x inside each checkbox to indicate that you've read and followed it:
[ ]
->[x]
If this is a documentation change, only the first checkbox must be filled (you can delete the others if you want).
go fmt ./...
andgolangci-lint run
.