mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-27 15:43:32 -06:00
fmt + lint
This commit is contained in:
parent
d68c64505b
commit
a602a3d9d2
21 changed files with 51 additions and 22 deletions
|
|
@ -42,7 +42,7 @@ func (m *Module) TokenPOSTHandler(c *gin.Context) {
|
|||
|
||||
form := &tokenBody{}
|
||||
if err := c.ShouldBind(form); err == nil {
|
||||
c.Request.Form = url.Values{}
|
||||
c.Request.Form = url.Values{}
|
||||
if form.ClientID != nil {
|
||||
c.Request.Form.Set("client_id", *form.ClientID)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,6 +25,8 @@ import (
|
|||
"github.com/superseriousbusiness/gotosocial/internal/oauth"
|
||||
)
|
||||
|
||||
// FollowRequestAcceptPOSTHandler deals with follow request accepting. It should be served at
|
||||
// /api/v1/follow_requests/:id/authorize
|
||||
func (m *Module) FollowRequestAcceptPOSTHandler(c *gin.Context) {
|
||||
l := m.log.WithField("func", "statusCreatePOSTHandler")
|
||||
authed, err := oauth.Authed(c, true, true, true, true)
|
||||
|
|
|
|||
|
|
@ -20,6 +20,8 @@ package followrequest
|
|||
|
||||
import "github.com/gin-gonic/gin"
|
||||
|
||||
// FollowRequestDenyPOSTHandler deals with follow request rejection. It should be served at
|
||||
// /api/v1/follow_requests/:id/reject
|
||||
func (m *Module) FollowRequestDenyPOSTHandler(c *gin.Context) {
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ import (
|
|||
"github.com/superseriousbusiness/gotosocial/internal/oauth"
|
||||
)
|
||||
|
||||
// FollowRequestGETHandler allows clients to get a list of their incoming follow requests.
|
||||
func (m *Module) FollowRequestGETHandler(c *gin.Context) {
|
||||
l := m.log.WithField("func", "statusCreatePOSTHandler")
|
||||
authed, err := oauth.Authed(c, true, true, true, true)
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ import (
|
|||
)
|
||||
|
||||
const (
|
||||
// InstanceInformationPath
|
||||
// InstanceInformationPath is for serving instance info requests
|
||||
InstanceInformationPath = "api/v1/instance"
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import (
|
|||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
// InstanceInformationGETHandler is for serving instance information at /api/v1/instance
|
||||
func (m *Module) InstanceInformationGETHandler(c *gin.Context) {
|
||||
l := m.log.WithField("func", "InstanceInformationGETHandler")
|
||||
|
||||
|
|
|
|||
|
|
@ -33,8 +33,10 @@ import (
|
|||
|
||||
// BasePath is the base API path for making media requests
|
||||
const BasePath = "/api/v1/media"
|
||||
|
||||
// IDKey is the key for media attachment IDs
|
||||
const IDKey = "id"
|
||||
|
||||
// BasePathWithID corresponds to a media attachment with the given ID
|
||||
const BasePathWithID = BasePath + "/:" + IDKey
|
||||
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ func (m *Module) MediaGETHandler(c *gin.Context) {
|
|||
|
||||
attachment, errWithCode := m.processor.MediaGet(authed, attachmentID)
|
||||
if errWithCode != nil {
|
||||
c.JSON(errWithCode.Code(),gin.H{"error": errWithCode.Safe()})
|
||||
c.JSON(errWithCode.Code(), gin.H{"error": errWithCode.Safe()})
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -28,11 +28,11 @@ type AttachmentRequest struct {
|
|||
Focus string `form:"focus"`
|
||||
}
|
||||
|
||||
// AttachmentRequest represents the form data parameters submitted by a client during a media update/PUT request.
|
||||
// AttachmentUpdateRequest represents the form data parameters submitted by a client during a media update/PUT request.
|
||||
// See: https://docs.joinmastodon.org/methods/statuses/media/
|
||||
type AttachmentUpdateRequest struct {
|
||||
Description *string `form:"description" json:"description" xml:"description"`
|
||||
Focus *string `form:"focus" json:"focus" xml:"focus"`
|
||||
Description *string `form:"description" json:"description" xml:"description"`
|
||||
Focus *string `form:"focus" json:"focus" xml:"focus"`
|
||||
}
|
||||
|
||||
// Attachment represents the object returned to a client after a successful media upload request.
|
||||
|
|
|
|||
|
|
@ -119,11 +119,15 @@ const (
|
|||
VisibilityDirect Visibility = "direct"
|
||||
)
|
||||
|
||||
// AdvancedStatusCreateForm wraps the mastodon status create form along with the GTS advanced
|
||||
// visibility settings.
|
||||
type AdvancedStatusCreateForm struct {
|
||||
StatusCreateRequest
|
||||
AdvancedVisibilityFlagsForm
|
||||
}
|
||||
|
||||
// AdvancedVisibilityFlagsForm allows a few more advanced flags to be set on new statuses, in addition
|
||||
// to the standard mastodon-compatible ones.
|
||||
type AdvancedVisibilityFlagsForm struct {
|
||||
// The gotosocial visibility model
|
||||
VisibilityAdvanced *string `form:"visibility_advanced"`
|
||||
|
|
|
|||
|
|
@ -26,6 +26,8 @@ import (
|
|||
"github.com/superseriousbusiness/gotosocial/internal/message"
|
||||
)
|
||||
|
||||
// InboxPOSTHandler deals with incoming POST requests to an actor's inbox.
|
||||
// Eg., POST to https://example.org/users/whatever/inbox.
|
||||
func (m *Module) InboxPOSTHandler(c *gin.Context) {
|
||||
l := m.log.WithFields(logrus.Fields{
|
||||
"func": "InboxPOSTHandler",
|
||||
|
|
|
|||
|
|
@ -38,7 +38,8 @@ const (
|
|||
// Use this anywhere you need to know the username of the user being queried.
|
||||
// Eg https://example.org/users/:username
|
||||
UsersBasePathWithUsername = UsersBasePath + "/:" + UsernameKey
|
||||
UsersInboxPath = UsersBasePathWithUsername + "/" + util.InboxPath
|
||||
// UsersInboxPath is for serving POST requests to a user's inbox with the given username key.
|
||||
UsersInboxPath = UsersBasePathWithUsername + "/" + util.InboxPath
|
||||
)
|
||||
|
||||
// ActivityPubAcceptHeaders represents the Accept headers mentioned here:
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ import (
|
|||
)
|
||||
|
||||
const (
|
||||
// The base path for serving webfinger lookup requests
|
||||
// WebfingerBasePath is the base path for serving webfinger lookup requests
|
||||
WebfingerBasePath = ".well-known/webfinger"
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue