mirror of
https://github.com/aljazceru/ditto.git
synced 2025-12-29 03:04:25 +01:00
Make the local timeline correctly filter only local users
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
import { z } from '@/deps.ts';
|
||||
import { getFeed, getPublicFeed } from '@/queries.ts';
|
||||
import { booleanParamSchema } from '@/schema.ts';
|
||||
import { toStatus } from '@/transformers/nostr-to-mastoapi.ts';
|
||||
import { buildLinkHeader, paginationSchema } from '@/utils.ts';
|
||||
|
||||
@@ -19,10 +21,15 @@ const homeController: AppController = async (c) => {
|
||||
return c.json(statuses, 200, link ? { link } : undefined);
|
||||
};
|
||||
|
||||
const publicQuerySchema = z.object({
|
||||
local: booleanParamSchema.catch(false),
|
||||
});
|
||||
|
||||
const publicController: AppController = async (c) => {
|
||||
const params = paginationSchema.parse(c.req.query());
|
||||
const { local } = publicQuerySchema.parse(c.req.query());
|
||||
|
||||
const events = await getPublicFeed(params);
|
||||
const events = await getPublicFeed(params, local);
|
||||
if (!events.length) {
|
||||
return c.json([]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user