mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 11:52:25 -05:00
[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
This commit is contained in:
parent
303a6a6b1d
commit
0f812746b7
9 changed files with 132 additions and 70 deletions
|
|
@ -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,
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue