about summary refs log tree commit diff
path: root/app/lib/spam_check.rb
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2019-07-17 21:09:15 +0200
committerEugen Rochko <eugen@zeonfederated.com>2019-07-17 21:09:15 +0200
commit7e2b6da57f7689757a50fa261c480445b1846703 (patch)
tree1c9ecca76fcf3ce743c372314188361e429ed1f1 /app/lib/spam_check.rb
parentfccd25cf5397f8c2ee2df98e0cc46be3c2b1ea5d (diff)
Add setting to disable the anti-spam (#11296)
* Add environment variable to disable the anti-spam

* Move antispam setting to admin settings

* Fix typo

* antispam → spam_check
Diffstat (limited to 'app/lib/spam_check.rb')
-rw-r--r--app/lib/spam_check.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/lib/spam_check.rb b/app/lib/spam_check.rb
index 923d48a02..0cf1b8790 100644
--- a/app/lib/spam_check.rb
+++ b/app/lib/spam_check.rb
@@ -14,7 +14,7 @@ class SpamCheck
   end
 
   def skip?
-    already_flagged? || trusted? || no_unsolicited_mentions? || solicited_reply?
+    disabled? || already_flagged? || trusted? || no_unsolicited_mentions? || solicited_reply?
   end
 
   def spam?
@@ -80,6 +80,10 @@ class SpamCheck
 
   private
 
+  def disabled?
+    !Setting.spam_check_enabled
+  end
+
   def remove_mentions(text)
     return text.gsub(Account::MENTION_RE, '') if @status.local?