[backend/federation] Ensure pinned notes belong to the actor whose collection they're contained in
This commit is contained in:
parent
a56d7f521c
commit
07f79ae77b
1 changed files with 6 additions and 3 deletions
|
@ -1237,8 +1237,11 @@ public class NoteService(
|
||||||
|
|
||||||
if (previousPins.SequenceEqual(notes.Where(p => p != null).Cast<Note>().Select(p => p.Id))) return;
|
if (previousPins.SequenceEqual(notes.Where(p => p != null).Cast<Note>().Select(p => p.Id))) return;
|
||||||
|
|
||||||
var pins = notes.Where(p => p != null)
|
if (notes.OfType<Note>().Any(p => p.User != user))
|
||||||
.Cast<Note>()
|
throw GracefulException
|
||||||
|
.UnprocessableEntity("Refusing to ingest pinned notes attributed to different actor");
|
||||||
|
|
||||||
|
var pins = notes.OfType<Note>()
|
||||||
.Select(p => new UserNotePin
|
.Select(p => new UserNotePin
|
||||||
{
|
{
|
||||||
Id = IdHelpers.GenerateSlowflakeId(),
|
Id = IdHelpers.GenerateSlowflakeId(),
|
||||||
|
|
Loading…
Add table
Reference in a new issue