diff options
author | 2023-11-08 14:32:17 +0000 | |
---|---|---|
committer | 2023-11-08 14:32:17 +0000 | |
commit | e9e5dc5a40926e5320cb131b035c46b1e1b0bd59 (patch) | |
tree | 52edc9fa5742f28e1e5223f51cda628ec1c35a24 /internal/api/client/statuses/statuscreate.go | |
parent | [chore]: Bump github.com/spf13/cobra from 1.7.0 to 1.8.0 (#2338) (diff) | |
download | gotosocial-e9e5dc5a40926e5320cb131b035c46b1e1b0bd59.tar.xz |
[feature] add support for polls + receiving federated status edits (#2330)
Diffstat (limited to 'internal/api/client/statuses/statuscreate.go')
-rw-r--r-- | internal/api/client/statuses/statuscreate.go | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/internal/api/client/statuses/statuscreate.go b/internal/api/client/statuses/statuscreate.go index e8378f461..5034e53b1 100644 --- a/internal/api/client/statuses/statuscreate.go +++ b/internal/api/client/statuses/statuscreate.go @@ -103,7 +103,12 @@ func (m *Module) StatusCreatePOSTHandler(c *gin.Context) { return } - apiStatus, errWithCode := m.processor.Status().Create(c.Request.Context(), authed.Account, authed.Application, form) + apiStatus, errWithCode := m.processor.Status().Create( + c.Request.Context(), + authed.Account, + authed.Application, + form, + ) if errWithCode != nil { apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1) return @@ -144,7 +149,7 @@ func validateNormalizeCreateStatus(form *apimodel.AdvancedStatusCreateForm) erro } if form.Poll != nil { - if form.Poll.Options == nil { + if len(form.Poll.Options) == 0 { return errors.New("poll with no options") } if len(form.Poll.Options) > maxPollOptions { |