[backend/federation] ASNote.Subject should be text, not html
This commit is contained in:
parent
7824182371
commit
6c90d0554e
2 changed files with 4 additions and 5 deletions
|
@ -96,9 +96,7 @@ public class NoteRenderer(IOptions<Config.InstanceSection> config, MfmConverter
|
|||
Content = note.Text != null
|
||||
? await mfmConverter.ToHtmlAsync(note.Text, mentions, note.UserHost)
|
||||
: null,
|
||||
Summary = note.Cw != null
|
||||
? await mfmConverter.ToHtmlAsync(note.Cw, mentions, note.UserHost)
|
||||
: null,
|
||||
Summary = note.Cw,
|
||||
Source = note.Text != null
|
||||
? new ASNoteSource { Content = note.Text, MediaType = "text/x.misskeymarkdown" }
|
||||
: null
|
||||
|
|
|
@ -272,7 +272,7 @@ public class NoteService(
|
|||
Uri = note.Id,
|
||||
Url = note.Url?.Id, //FIXME: this doesn't seem to work yet
|
||||
Text = note.MkContent ?? await mfmConverter.FromHtmlAsync(note.Content, mentions),
|
||||
Cw = await mfmConverter.FromHtmlAsync(note.Summary), //TODO: mentions parsing?
|
||||
Cw = note.Summary,
|
||||
UserId = user.Id,
|
||||
CreatedAt = createdAt,
|
||||
UserHost = user.Host,
|
||||
|
@ -363,7 +363,7 @@ public class NoteService(
|
|||
|
||||
mentionedLocalUserIds = mentionedLocalUserIds.Except(previousMentionedLocalUserIds).ToList();
|
||||
dbNote.Text = note.MkContent ?? await mfmConverter.FromHtmlAsync(note.Content, mentions);
|
||||
dbNote.Cw = await mfmConverter.FromHtmlAsync(note.Summary); //TODO: mentions parsing?
|
||||
dbNote.Cw = note.Summary;
|
||||
|
||||
if (dbNote.Cw is { Length: > 100000 })
|
||||
throw GracefulException.UnprocessableEntity("Summary cannot be longer than 100.000 characters");
|
||||
|
@ -531,6 +531,7 @@ public class NoteService(
|
|||
logger.LogDebug("Failed to fetch note, skipping");
|
||||
return null;
|
||||
}
|
||||
|
||||
if (fetchedNote.AttributedTo is not [{ Id: not null } attrTo])
|
||||
{
|
||||
logger.LogDebug("Invalid Note.AttributedTo, skipping");
|
||||
|
|
Loading…
Add table
Reference in a new issue