From fe00cb9ad59ad23580d5022739cca3f3d277ce61 Mon Sep 17 00:00:00 2001 From: syuilo Date: Wed, 20 Feb 2019 22:31:21 +0900 Subject: ハイライトでミュートしているユーザーの投稿が含まれる問題を修正 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/server/api/endpoints/notes/featured.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/server/api') diff --git a/src/server/api/endpoints/notes/featured.ts b/src/server/api/endpoints/notes/featured.ts index 5d3404f1d6..7a3c2b76ee 100644 --- a/src/server/api/endpoints/notes/featured.ts +++ b/src/server/api/endpoints/notes/featured.ts @@ -2,6 +2,7 @@ import $ from 'cafy'; import Note from '../../../../models/note'; import { packMany } from '../../../../models/note'; import define from '../../define'; +import { getHideUserIds } from '../../common/get-hide-users'; export const meta = { desc: { @@ -25,6 +26,8 @@ export const meta = { export default define(meta, (ps, user) => new Promise(async (res, rej) => { const day = 1000 * 60 * 60 * 24 * 2; + const hideUserIds = await getHideUserIds(user); + const notes = await Note .find({ createdAt: { @@ -32,7 +35,8 @@ export default define(meta, (ps, user) => new Promise(async (res, rej) => { }, deletedAt: null, visibility: { $in: ['public', 'home'] }, - '_user.host': null + '_user.host': null, + ...(hideUserIds && hideUserIds.length > 0 ? { userId: { $nin: hideUserIds } } : {}) }, { limit: ps.limit, sort: { -- cgit v1.2.3-freya