fix: filter replies from public/local/hashtag timelines (Mastodon behavior)
This commit is contained in:
@@ -102,9 +102,10 @@ router.get("/api/v1/timelines/public", async (req, res, next) => {
|
|||||||
const baseUrl = `${req.protocol}://${req.get("host")}`;
|
const baseUrl = `${req.protocol}://${req.get("host")}`;
|
||||||
const limit = parseLimit(req.query.limit);
|
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 = {
|
const baseFilter = {
|
||||||
isContext: { $ne: true },
|
isContext: { $ne: true },
|
||||||
|
inReplyTo: { $exists: false },
|
||||||
visibility: "public",
|
visibility: "public",
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -204,6 +205,7 @@ router.get("/api/v1/timelines/tag/:hashtag", async (req, res, next) => {
|
|||||||
|
|
||||||
const baseFilter = {
|
const baseFilter = {
|
||||||
isContext: { $ne: true },
|
isContext: { $ne: true },
|
||||||
|
inReplyTo: { $exists: false },
|
||||||
visibility: { $in: ["public", "unlisted"] },
|
visibility: { $in: ["public", "unlisted"] },
|
||||||
category: hashtag,
|
category: hashtag,
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user