From 9edd865c2eb71eb11b1711ad25b526e5b9a29b38 Mon Sep 17 00:00:00 2001 From: anatawa12 Date: Thu, 27 Jul 2023 17:07:56 +0900 Subject: [PATCH] =?UTF-8?q?chore:=20=E3=83=8F=E3=82=A4=E3=83=A9=E3=82=A4?= =?UTF-8?q?=E3=83=88=E3=81=8B=E3=82=89=E5=86=99=E7=9C=9F=E3=81=AE=E3=81=AA?= =?UTF-8?q?=E3=81=84=E3=81=8A=E3=81=AFnote=E3=81=A8=E3=83=81=E3=83=A3?= =?UTF-8?q?=E3=83=B3=E3=83=8D=E3=83=AB=E6=8A=95=E7=A8=BF=E3=82=92=E9=99=A4?= =?UTF-8?q?=E5=A4=96=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 3 +++ .../src/server/api/endpoints/notes/featured.ts | 13 +++++++++++++ 2 files changed, 16 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f1970dee9..ef831ed310 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,9 @@ --> +### Server +- + ## 13.13.2-kinel-0.0.1 ### General diff --git a/packages/backend/src/server/api/endpoints/notes/featured.ts b/packages/backend/src/server/api/endpoints/notes/featured.ts index bdb06498bc..ebe026c5a1 100644 --- a/packages/backend/src/server/api/endpoints/notes/featured.ts +++ b/packages/backend/src/server/api/endpoints/notes/featured.ts @@ -1,4 +1,5 @@ import { Inject, Injectable } from '@nestjs/common'; +import { Brackets } from 'typeorm'; import type { NotesRepository } from '@/models/index.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { QueryService } from '@/core/QueryService.js'; @@ -60,6 +61,18 @@ export default class extends Endpoint { if (ps.channelId) query.andWhere('note.channelId = :channelId', { channelId: ps.channelId }); + if (!ps.channelId) { + // featured for welcome page. filter some notes + query.andWhere('note.channelId IS NULL', { channelId: ps.channelId }); + query.andWhere( + new Brackets(qb => { + qb.where('note.text NOT LIKE \'%おはよう%\'') + .andWhere('note.text NOT LIKE \'%:ohayo_nirila_misskey:%\'') + .orWhere('note.fileIds != \'{}\''); + }), + ); + } + if (me) this.queryService.generateMutedUserQuery(query, me); if (me) this.queryService.generateBlockedUserQuery(query, me);