From 218229939374cd398db8816d0fe4b235da63c19c Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 23 Dec 2017 04:26:37 +0900 Subject: [PATCH] oops --- src/api/endpoints/posts/search.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/api/endpoints/posts/search.ts b/src/api/endpoints/posts/search.ts index 33ef2a0a0..6cea5bdf5 100644 --- a/src/api/endpoints/posts/search.ts +++ b/src/api/endpoints/posts/search.ts @@ -99,8 +99,9 @@ async function byNative(res, rej, me, text, userId, following, mute, reply, repo if (text) { push({ $and: text.split(' ').map(x => ({ + // キーワードが-で始まる場合そのキーワードを除外する text: x[0] == '-' ? { - $ne: new RegExp(escapeRegexp(x.substr(1))) + $not: new RegExp(escapeRegexp(x.substr(1))) } : new RegExp(escapeRegexp(x)) })) });