[backend/core] Trim whitespace around note text & cw (ISH-150)
This commit is contained in:
parent
52a7f90697
commit
aaec212a08
1 changed files with 4 additions and 3 deletions
|
@ -98,8 +98,8 @@ public class NoteService(
|
||||||
var note = new Note
|
var note = new Note
|
||||||
{
|
{
|
||||||
Id = IdHelpers.GenerateSlowflakeId(),
|
Id = IdHelpers.GenerateSlowflakeId(),
|
||||||
Text = text,
|
Text = text?.Trim(),
|
||||||
Cw = cw,
|
Cw = cw?.Trim(),
|
||||||
Reply = reply,
|
Reply = reply,
|
||||||
ReplyUserId = reply?.UserId,
|
ReplyUserId = reply?.UserId,
|
||||||
ReplyUserHost = reply?.UserHost,
|
ReplyUserHost = reply?.UserHost,
|
||||||
|
@ -244,7 +244,8 @@ public class NoteService(
|
||||||
text = mentionsResolver.ResolveMentions(text, null, mentions, splitDomainMapping);
|
text = mentionsResolver.ResolveMentions(text, null, mentions, splitDomainMapping);
|
||||||
|
|
||||||
mentionedLocalUserIds = mentionedLocalUserIds.Except(previousMentionedLocalUserIds).ToList();
|
mentionedLocalUserIds = mentionedLocalUserIds.Except(previousMentionedLocalUserIds).ToList();
|
||||||
note.Text = text;
|
note.Text = text?.Trim();
|
||||||
|
note.Cw = cw?.Trim();
|
||||||
note.Tags = ResolveHashtags(text);
|
note.Tags = ResolveHashtags(text);
|
||||||
|
|
||||||
if (text is not null)
|
if (text is not null)
|
||||||
|
|
Loading…
Add table
Reference in a new issue