[backend/core] Trim whitespace around note text & cw (ISH-150)

This commit is contained in:
Laura Hausmann 2024-03-09 01:36:55 +01:00
parent 52a7f90697
commit aaec212a08
No known key found for this signature in database
GPG key ID: D044E84C5BE01605

View file

@ -98,8 +98,8 @@ public class NoteService(
var note = new Note
{
Id = IdHelpers.GenerateSlowflakeId(),
Text = text,
Cw = cw,
Text = text?.Trim(),
Cw = cw?.Trim(),
Reply = reply,
ReplyUserId = reply?.UserId,
ReplyUserHost = reply?.UserHost,
@ -244,7 +244,8 @@ public class NoteService(
text = mentionsResolver.ResolveMentions(text, null, mentions, splitDomainMapping);
mentionedLocalUserIds = mentionedLocalUserIds.Except(previousMentionedLocalUserIds).ToList();
note.Text = text;
note.Text = text?.Trim();
note.Cw = cw?.Trim();
note.Tags = ResolveHashtags(text);
if (text is not null)