diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2017-12-23 04:26:37 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2017-12-23 04:26:37 +0900 |
| commit | 020ce794af9493d3a037bc4cd942c6f0fac75330 (patch) | |
| tree | 129fadcba5b4391010419f361c1c985ca1f47083 /src/api | |
| parent | oops (diff) | |
| download | sharkey-020ce794af9493d3a037bc4cd942c6f0fac75330.tar.gz sharkey-020ce794af9493d3a037bc4cd942c6f0fac75330.tar.bz2 sharkey-020ce794af9493d3a037bc4cd942c6f0fac75330.zip | |
oops
Diffstat (limited to 'src/api')
| -rw-r--r-- | src/api/endpoints/posts/search.ts | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/api/endpoints/posts/search.ts b/src/api/endpoints/posts/search.ts index 33ef2a0a05..6cea5bdf53 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)) })) }); |