From 91ef328b6baab4d241668bc04548ccbcf106a628 Mon Sep 17 00:00:00 2001 From: syuilo Date: Wed, 20 Feb 2019 22:34:52 +0900 Subject: 「みつける」でミュートしているユーザーが含まれる問題を修正 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/server/api/endpoints/users.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/server/api/endpoints') diff --git a/src/server/api/endpoints/users.ts b/src/server/api/endpoints/users.ts index 8e83dca350..fd8cc6413e 100644 --- a/src/server/api/endpoints/users.ts +++ b/src/server/api/endpoints/users.ts @@ -2,6 +2,7 @@ import $ from 'cafy'; import User, { pack } from '../../../models/user'; import define from '../define'; import { fallback } from '../../../prelude/symbol'; +import { getHideUserIds } from '../common/get-hide-users'; const nonnull = { $ne: null as any }; @@ -86,12 +87,15 @@ const sort: any = { // < https://github.com/Microsoft/TypeScript/issues/1863 }; export default define(meta, (ps, me) => new Promise(async (res, rej) => { + const hideUserIds = await getHideUserIds(me); + const users = await User .find({ $and: [ state[ps.state] || state[fallback], origin[ps.origin] || origin[fallback] - ] + ], + ...(hideUserIds && hideUserIds.length > 0 ? { _id: { $nin: hideUserIds } } : {}) }, { limit: ps.limit, sort: sort[ps.sort] || sort[fallback], -- cgit v1.2.3-freya