summaryrefslogtreecommitdiff
path: root/src/api/endpoints/posts
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2017-12-23 04:21:15 +0900
committersyuilo <syuilotan@yahoo.co.jp>2017-12-23 04:21:15 +0900
commit8376b10b3b93d3c6cc50d69a6f0ae3ceb8c96c74 (patch)
tree11037986af1097c76a9c413bea5b8a082b8f86ef /src/api/endpoints/posts
parentUpdate search.ja.pug (diff)
downloadsharkey-8376b10b3b93d3c6cc50d69a6f0ae3ceb8c96c74.tar.gz
sharkey-8376b10b3b93d3c6cc50d69a6f0ae3ceb8c96c74.tar.bz2
sharkey-8376b10b3b93d3c6cc50d69a6f0ae3ceb8c96c74.zip
#1035
Diffstat (limited to 'src/api/endpoints/posts')
-rw-r--r--src/api/endpoints/posts/search.ts4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/api/endpoints/posts/search.ts b/src/api/endpoints/posts/search.ts
index f722231d4c..4697e6ed0f 100644
--- a/src/api/endpoints/posts/search.ts
+++ b/src/api/endpoints/posts/search.ts
@@ -99,7 +99,9 @@ async function byNative(res, rej, me, text, userId, following, mute, reply, repo
if (text) {
push({
$and: text.split(' ').map(x => ({
- text: new RegExp(escapeRegexp(x))
+ text: x[0] == '-' ? {
+ $ne: new RegExp(escapeRegexp(x))
+ } : new RegExp(escapeRegexp(x))
}))
});
}