From 91e0a59d553b178ef97697f849bfc62388fd94aa Mon Sep 17 00:00:00 2001 From: anatawa12 Date: Sun, 6 Aug 2023 16:42:06 +0900 Subject: [PATCH 1/2] fix: cw execution will exclude all notes without cw --- .../backend/src/server/api/endpoints/notes/featured.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/backend/src/server/api/endpoints/notes/featured.ts b/packages/backend/src/server/api/endpoints/notes/featured.ts index 85ac02fed4..ca79d57c24 100644 --- a/packages/backend/src/server/api/endpoints/notes/featured.ts +++ b/packages/backend/src/server/api/endpoints/notes/featured.ts @@ -68,8 +68,11 @@ export default class extends Endpoint { new Brackets(qb => { qb.where('note.text NOT LIKE \'%おはよう%\'') .andWhere('note.text NOT LIKE \'%:ohayo_nirila_misskey:%\'') - .andWhere('note.cw NOT LIKE \'%おはよう%\'') - .andWhere('note.cw NOT LIKE \'%:ohayo_nirila_misskey:%\'') + .andWhere(new Brackets(qb => { + qb.where('note.cw NOT LIKE \'%おはよう%\'') + .andWhere('note.cw NOT LIKE \'%:ohayo_nirila_misskey:%\'') + .orWhere('note.cw IS NULL'); + })) .orWhere('note.fileIds != \'{}\''); }), ); From 8a19c96f3277953c750700f610ad62877db96d4d Mon Sep 17 00:00:00 2001 From: anatawa12 Date: Sun, 6 Aug 2023 16:46:35 +0900 Subject: [PATCH 2/2] chore: do not exclude non sensitive channels in featured --- CHANGELOG.md | 1 + packages/backend/src/server/api/endpoints/notes/featured.ts | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 362865f7f7..183184eccb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ ### General - ハイライトからのおはnoteの除外でCWを見忘れていたのを修正 - チャンネルをセンシティブ指定できるようになりました +- ハイライトから除外するチャンネルをsensitiveチャンネルのみにしました ### Client diff --git a/packages/backend/src/server/api/endpoints/notes/featured.ts b/packages/backend/src/server/api/endpoints/notes/featured.ts index 85ac02fed4..0e9681e1b1 100644 --- a/packages/backend/src/server/api/endpoints/notes/featured.ts +++ b/packages/backend/src/server/api/endpoints/notes/featured.ts @@ -63,7 +63,6 @@ export default class extends Endpoint { 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 \'%おはよう%\'') @@ -73,6 +72,11 @@ export default class extends Endpoint { .orWhere('note.fileIds != \'{}\''); }), ); + query.leftJoinAndSelect('note.channel', 'channel') + .andWhere(new Brackets(qb => { + qb.where('channel.isSensitive IS NULL') + .orWhere('channel.isSensitive = FALSE'); + })); } if (me) this.queryService.generateMutedUserQuery(query, me);