mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-08 07:51:10 -06:00
[feature] Parse content warning as HTML, serialize via API to plaintext
This commit is contained in:
parent
69461c461b
commit
22ce924129
47 changed files with 947 additions and 553 deletions
|
|
@ -297,13 +297,22 @@ func (p *Processor) Edit(
|
|||
// update the other necessary status fields.
|
||||
status.Content = content.Content
|
||||
status.ContentWarning = content.ContentWarning
|
||||
status.Text = form.Status
|
||||
status.Text = form.Status // raw
|
||||
status.Language = content.Language
|
||||
status.Sensitive = &form.Sensitive
|
||||
status.AttachmentIDs = form.MediaIDs
|
||||
status.Attachments = media
|
||||
status.EditedAt = now
|
||||
|
||||
// Only store ContentWarningText if the parsed
|
||||
// result is different from the given SpoilerText,
|
||||
// otherwise skip to avoid duplicating db columns.
|
||||
var contentWarningText string
|
||||
if content.ContentWarning != form.SpoilerText {
|
||||
contentWarningText = form.SpoilerText
|
||||
}
|
||||
status.ContentWarningText = contentWarningText // raw
|
||||
|
||||
if poll != nil {
|
||||
// Set relevent fields for latest with poll.
|
||||
status.ActivityStreamsType = ap.ActivityQuestion
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue