summaryrefslogtreecommitdiff
path: root/internal/processing/status/create.go
diff options
context:
space:
mode:
authorLibravatar Vyr Cossont <VyrCossont@users.noreply.github.com>2023-08-07 01:25:54 -0700
committerLibravatar GitHub <noreply@github.com>2023-08-07 10:25:54 +0200
commit0f812746b7fd9dfeef41e329af5215772672689a (patch)
treeadfc0c9e4412982224d32019b8abfc2895cd3f66 /internal/processing/status/create.go
parent[chore]: Bump golang.org/x/oauth2 from 0.10.0 to 0.11.0 (#2076) (diff)
downloadgotosocial-0f812746b7fd9dfeef41e329af5215772672689a.tar.xz
[feature] Allow full BCP 47 in language inputs (#2067)
* Allow full BCP 47 in language inputs Fixes #2066 * Fuse validation and normalization for languages * Remove outdated comment line * Move post language canonicalization test
Diffstat (limited to 'internal/processing/status/create.go')
-rw-r--r--internal/processing/status/create.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/internal/processing/status/create.go b/internal/processing/status/create.go
index 2d9c3a196..36842ee07 100644
--- a/internal/processing/status/create.go
+++ b/internal/processing/status/create.go
@@ -37,6 +37,8 @@ import (
)
// Create processes the given form to create a new status, returning the api model representation of that status if it's OK.
+//
+// Precondition: the form's fields should have already been validated and normalized by the caller.
func (p *Processor) Create(ctx context.Context, account *gtsmodel.Account, application *gtsmodel.Application, form *apimodel.AdvancedStatusCreateForm) (*apimodel.Status, gtserror.WithCode) {
accountURIs := uris.GenerateURIsForAccount(account.Username)
thisStatusID := id.NewULID()
@@ -55,7 +57,6 @@ func (p *Processor) Create(ctx context.Context, account *gtsmodel.Account, appli
ContentWarning: text.SanitizePlaintext(form.SpoilerText),
ActivityStreamsType: ap.ObjectNote,
Sensitive: &sensitive,
- Language: form.Language,
CreatedWithApplicationID: application.ID,
Text: form.Status,
}