From c34a27853376efe38e1596558f300c836e724359 Mon Sep 17 00:00:00 2001 From: MeiMei <30769358+mei23@users.noreply.github.com> Date: Thu, 31 Jan 2019 23:14:45 +0900 Subject: [PATCH] =?UTF-8?q?=E3=81=8A=E3=81=99=E3=81=99=E3=82=81=E3=81=AE?= =?UTF-8?q?=E3=82=A2=E3=83=B3=E3=82=B1=E3=83=BC=E3=83=88=E3=81=A7=E3=83=9F?= =?UTF-8?q?=E3=83=A5=E3=83=BC=E3=83=88=E3=83=A6=E3=83=BC=E3=82=B6=E3=83=BC?= =?UTF-8?q?=E3=81=AE=E3=82=82=E3=81=AE=E3=81=AF=E8=A1=A8=E7=A4=BA=E3=81=97?= =?UTF-8?q?=E3=81=AA=E3=81=84=20(#4067)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/server/api/endpoints/notes/polls/recommendation.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/server/api/endpoints/notes/polls/recommendation.ts b/src/server/api/endpoints/notes/polls/recommendation.ts index 2bc1a4f91..ddb089279 100644 --- a/src/server/api/endpoints/notes/polls/recommendation.ts +++ b/src/server/api/endpoints/notes/polls/recommendation.ts @@ -2,6 +2,7 @@ import $ from 'cafy'; import Vote from '../../../../../models/poll-vote'; import Note, { pack } from '../../../../../models/note'; import define from '../../../define'; +import Mute from '../../../../../models/mute'; export const meta = { desc: { @@ -37,6 +38,11 @@ export default define(meta, (ps, user) => new Promise(async (res, rej) => { const nin = votes && votes.length != 0 ? votes.map(v => v.noteId) : []; + // ミュートしているユーザーを取得 + const mutedUserIds = await Mute.find({ + muterId: user._id + }).then(ms => ms.map(m => m.muteeId)); + const notes = await Note .find({ '_user.host': null, @@ -44,7 +50,8 @@ export default define(meta, (ps, user) => new Promise(async (res, rej) => { $nin: nin }, userId: { - $ne: user._id + $ne: user._id, + $nin: mutedUserIds }, poll: { $exists: true,