summaryrefslogtreecommitdiff
path: root/src/api/endpoints/posts
diff options
context:
space:
mode:
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))
}))
});
}