summaryrefslogtreecommitdiff
path: root/src/server/api/endpoints/notes
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2019-02-20 22:31:21 +0900
committersyuilo <syuilotan@yahoo.co.jp>2019-02-20 22:31:21 +0900
commitfe00cb9ad59ad23580d5022739cca3f3d277ce61 (patch)
treeef598c4eb6dd85638a7c89a57ca8db35c11085af /src/server/api/endpoints/notes
parentFix #4333 (diff)
downloadsharkey-fe00cb9ad59ad23580d5022739cca3f3d277ce61.tar.gz
sharkey-fe00cb9ad59ad23580d5022739cca3f3d277ce61.tar.bz2
sharkey-fe00cb9ad59ad23580d5022739cca3f3d277ce61.zip
ハイライトでミュートしているユーザーの投稿が含まれる問題を修正
Diffstat (limited to 'src/server/api/endpoints/notes')
-rw-r--r--src/server/api/endpoints/notes/featured.ts6
1 files changed, 5 insertions, 1 deletions
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: {