[backend/masto-client] Apply limit to note ancestors/descendants queries

This commit is contained in:
Laura Hausmann 2024-02-12 02:36:44 +01:00
parent 8745f72ea7
commit e61736b588
No known key found for this signature in database
GPG key ID: D044E84C5BE01605

View file

@ -53,12 +53,14 @@ public class StatusController(DatabaseContext db, NoteRenderer noteRenderer, Not
throw GracefulException.RecordNotFound();
var ancestors = await db.NoteAncestors(id, maxAncestors)
.Take(maxAncestors)
.IncludeCommonProperties()
.EnsureVisibleFor(user)
.PrecomputeVisibilities(user)
.RenderAllForMastodonAsync(noteRenderer);
var descendants = await db.NoteDescendants(id, maxDepth, maxDescendants)
.Take(maxDescendants)
.IncludeCommonProperties()
.EnsureVisibleFor(user)
.PrecomputeVisibilities(user)