mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-23 07:56:20 -06:00
Write status content type on create/edit
This commit is contained in:
parent
49e649068c
commit
e51a787162
4 changed files with 57 additions and 11 deletions
|
|
@ -66,11 +66,22 @@ func (p *Processor) Create(
|
|||
// Generate new ID for status.
|
||||
statusID := id.NewULID()
|
||||
|
||||
// Process incoming content type
|
||||
contentType := form.ContentType
|
||||
if contentType == "" {
|
||||
// If not set in the form, use the user's default
|
||||
contentType = apimodel.StatusContentType(requester.Settings.StatusContentType)
|
||||
if contentType == "" {
|
||||
// ??? use the global default value
|
||||
contentType = apimodel.StatusContentTypeDefault
|
||||
}
|
||||
}
|
||||
|
||||
// Process incoming status content fields.
|
||||
content, errWithCode := p.processContent(ctx,
|
||||
requester,
|
||||
statusID,
|
||||
string(form.ContentType),
|
||||
contentType,
|
||||
form.Status,
|
||||
form.SpoilerText,
|
||||
form.Language,
|
||||
|
|
@ -159,6 +170,9 @@ func (p *Processor) Create(
|
|||
// Set validated language.
|
||||
Language: content.Language,
|
||||
|
||||
// Set resolved content type.
|
||||
ContentType: typeutils.APIContentTypeToContentType(contentType),
|
||||
|
||||
// Set formatted status content.
|
||||
Content: content.Content,
|
||||
ContentWarning: content.ContentWarning,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue