From 8d833bec89312edc2e4c8474535b7019ba7e483c Mon Sep 17 00:00:00 2001 From: Ricardo Date: Tue, 31 Mar 2026 19:56:32 +0200 Subject: [PATCH] fix: filter replies from public/local/hashtag timelines (Mastodon behavior) --- lib/mastodon/routes/timelines.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/mastodon/routes/timelines.js b/lib/mastodon/routes/timelines.js index 54a6124..01328ca 100644 --- a/lib/mastodon/routes/timelines.js +++ b/lib/mastodon/routes/timelines.js @@ -102,9 +102,10 @@ router.get("/api/v1/timelines/public", async (req, res, next) => { const baseUrl = `${req.protocol}://${req.get("host")}`; const limit = parseLimit(req.query.limit); - // Public timeline: only public visibility, no context items + // Public timeline: only public visibility, no context items, no replies const baseFilter = { isContext: { $ne: true }, + inReplyTo: { $exists: false }, visibility: "public", }; @@ -204,6 +205,7 @@ router.get("/api/v1/timelines/tag/:hashtag", async (req, res, next) => { const baseFilter = { isContext: { $ne: true }, + inReplyTo: { $exists: false }, visibility: { $in: ["public", "unlisted"] }, category: hashtag, };