diff options
author | 2024-02-23 19:28:09 +0100 | |
---|---|---|
committer | 2024-02-23 18:28:09 +0000 | |
commit | 4b0eefbcc9c30f1f34092be89a83936ab9ca04ed (patch) | |
tree | b6ee638a569b5cc9c6934fce268865d098a327c4 /internal/api | |
parent | [bugfix] 2643 bug search for account url doesnt always work when redirected (... (diff) | |
download | gotosocial-4b0eefbcc9c30f1f34092be89a83936ab9ca04ed.tar.xz |
[chore] Increase default max image description to 1500 chars, collapse cw char count into status (#2682)
* [chore] Make default max image description 1500 chars, collapse cw char count into status
* oops
* tests
Diffstat (limited to 'internal/api')
-rw-r--r-- | internal/api/client/statuses/statuscreate.go | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/internal/api/client/statuses/statuscreate.go b/internal/api/client/statuses/statuscreate.go index cc9b78384..929adaa6f 100644 --- a/internal/api/client/statuses/statuscreate.go +++ b/internal/api/client/statuses/statuscreate.go @@ -137,15 +137,11 @@ func validateNormalizeCreateStatus(form *apimodel.AdvancedStatusCreateForm) erro } maxChars := config.GetStatusesMaxChars() - maxMediaFiles := config.GetStatusesMediaMaxFiles() - maxCwChars := config.GetStatusesCWMaxChars() - - if form.Status != "" { - if length := len([]rune(form.Status)); length > maxChars { - return fmt.Errorf("status too long, %d characters provided but limit is %d", length, maxChars) - } + if length := len([]rune(form.Status)) + len([]rune(form.SpoilerText)); length > maxChars { + return fmt.Errorf("status too long, %d characters provided (including spoiler/content warning) but limit is %d", length, maxChars) } + maxMediaFiles := config.GetStatusesMediaMaxFiles() if len(form.MediaIDs) > maxMediaFiles { return fmt.Errorf("too many media files attached to status, %d attached but limit is %d", len(form.MediaIDs), maxMediaFiles) } @@ -156,12 +152,6 @@ func validateNormalizeCreateStatus(form *apimodel.AdvancedStatusCreateForm) erro } } - if form.SpoilerText != "" { - if length := len([]rune(form.SpoilerText)); length > maxCwChars { - return fmt.Errorf("content-warning/spoilertext too long, %d characters provided but limit is %d", length, maxCwChars) - } - } - if form.Language != "" { language, err := validate.Language(form.Language) if err != nil { |