ensure ContentType is updated anywhere Text is

This commit is contained in:
ewin 2025-03-03 16:42:04 -05:00
commit cd53543ec1
No known key found for this signature in database
4 changed files with 4 additions and 3 deletions

View file

@ -649,6 +649,7 @@ func sizeofStatus() uintptr {
URL: exampleURI,
Content: exampleText,
Text: exampleText,
ContentType: gtsmodel.StatusContentTypePlain,
AttachmentIDs: []string{exampleID, exampleID, exampleID},
TagIDs: []string{exampleID, exampleID, exampleID},
MentionIDs: []string{},

View file

@ -1239,6 +1239,7 @@ func (d *Dereferencer) handleStatusEdit(
edit.Content = existing.Content
edit.ContentWarning = existing.ContentWarning
edit.Text = existing.Text
edit.ContentType = existing.ContentType
edit.Language = existing.Language
edit.Sensitive = existing.Sensitive
edit.StatusID = status.ID

View file

@ -170,13 +170,11 @@ 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,
Text: form.Status, // raw
ContentType: typeutils.APIContentTypeToContentType(contentType),
// Set gathered mentions.
MentionIDs: content.MentionIDs,

View file

@ -303,6 +303,7 @@ func (p *Processor) Edit(
status.Content = content.Content
status.ContentWarning = content.ContentWarning
status.Text = form.Status
status.ContentType = typeutils.APIContentTypeToContentType(form.ContentType)
status.Language = content.Language
status.Sensitive = &form.Sensitive
status.AttachmentIDs = form.MediaIDs