Merge pull request #12 from anatawa12/niri-la/mute-channel-from-featured
chore: ハイライトから写真のないおはnoteとチャンネル投稿を除外する
This commit is contained in:
commit
21b3edc17c
|
@ -23,6 +23,7 @@
|
|||
- identicon生成を無効にしてパフォーマンスを向上させることができるようになりました
|
||||
- サーバーのマシン情報の公開を無効にしてパフォーマンスを向上させることができるようになりました
|
||||
- 管理者専用の他人を見るwebhookが増えました
|
||||
- ハイライトからおはnoteとチャンネル投稿を除外するようになりました
|
||||
|
||||
### Client
|
||||
- ドライブファイルのメニューで画像をクロップできるように
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue