add "show bots" toggle to following feed

This commit is contained in:
Hazelnoot 2024-10-12 14:56:04 -04:00
parent 24fd35e03d
commit 9b1bae653d
6 changed files with 35 additions and 7 deletions

View file

@ -37,6 +37,7 @@ export const paramDef = {
includeNonPublic: { type: 'boolean', default: false },
includeReplies: { type: 'boolean', default: false },
includeQuotes: { type: 'boolean', default: false },
includeBots: { type: 'boolean', default: true },
limit: { type: 'integer', minimum: 1, maximum: 100, default: 10 },
sinceId: { type: 'string', format: 'misskey:id' },
@ -97,6 +98,11 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
query.andWhere('latest.is_quote = false');
}
// Match selected user types.
if (!ps.includeBots) {
query.andWhere('"user"."isBot" = false');
}
// Respect blocks and mutes
this.queryService.generateBlockedUserQuery(query, me);
this.queryService.generateMutedUserQuery(query, me);