[backend/core] Set threadId on notes with replies

This commit is contained in:
Laura Hausmann 2024-02-26 23:54:49 +01:00
parent 13f0f0e686
commit fa7b98c366
No known key found for this signature in database
GPG key ID: D044E84C5BE01605

View file

@ -91,7 +91,8 @@ public class NoteService(
AttachedFileTypes = attachments?.Select(p => p.Type).ToList() ?? [], AttachedFileTypes = attachments?.Select(p => p.Type).ToList() ?? [],
Mentions = mentionedUserIds, Mentions = mentionedUserIds,
VisibleUserIds = visibility == Note.NoteVisibility.Specified ? mentionedUserIds : [], VisibleUserIds = visibility == Note.NoteVisibility.Specified ? mentionedUserIds : [],
MentionedRemoteUsers = remoteMentions MentionedRemoteUsers = remoteMentions,
ThreadId = reply?.ThreadId ?? reply?.Id
}; };
if (!note.IsPureRenote) user.NotesCount++; if (!note.IsPureRenote) user.NotesCount++;
@ -358,6 +359,7 @@ public class NoteService(
{ {
dbNote.ReplyUserId = dbNote.Reply.UserId; dbNote.ReplyUserId = dbNote.Reply.UserId;
dbNote.ReplyUserHost = dbNote.Reply.UserHost; dbNote.ReplyUserHost = dbNote.Reply.UserHost;
dbNote.ThreadId = dbNote.Reply.ThreadId ?? dbNote.Reply.ThreadId;
} }
if (dbNote.Renote != null) if (dbNote.Renote != null)