Merge pull request #12 from anatawa12/niri-la/mute-channel-from-featured

chore: ハイライトから写真のないおはnoteとチャンネル投稿を除外する
This commit is contained in:
anatawa12 2023-07-27 20:13:28 +09:00 committed by GitHub
commit 21b3edc17c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 0 deletions

View File

@ -23,6 +23,7 @@
- identicon生成を無効にしてパフォーマンスを向上させることができるようになりました
- サーバーのマシン情報の公開を無効にしてパフォーマンスを向上させることができるようになりました
- 管理者専用の他人を見るwebhookが増えました
- ハイライトからおはnoteとチャンネル投稿を除外するようになりました
### Client
- ドライブファイルのメニューで画像をクロップできるように

View File

@ -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<typeof meta, typeof paramDef> {
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);