Return a value from processContentType instead of modifying the existing status

Fixes an issue that was caught by the test I just added - the recorded edit would be marked with the *new* content type instead of the old one, which is obviously bad
This commit is contained in:
ewin 2025-03-05 13:19:39 -05:00
commit 921ba6481b
No known key found for this signature in database
3 changed files with 19 additions and 23 deletions

View file

@ -110,7 +110,7 @@ func (p *Processor) processContent(
ctx context.Context,
author *gtsmodel.Account,
statusID string,
contentType apimodel.StatusContentType,
contentType gtsmodel.StatusContentType,
content string,
contentWarning string,
language string,
@ -149,11 +149,11 @@ func (p *Processor) processContent(
switch contentType {
// Format status according to text/plain.
case apimodel.StatusContentTypePlain:
case gtsmodel.StatusContentTypePlain:
format = p.formatter.FromPlain
// Format status according to text/markdown.
case apimodel.StatusContentTypeMarkdown:
case gtsmodel.StatusContentTypeMarkdown:
format = p.formatter.FromMarkdown
// Unknown.