From 7e2b6da57f7689757a50fa261c480445b1846703 Mon Sep 17 00:00:00 2001 From: ThibG Date: Wed, 17 Jul 2019 21:09:15 +0200 Subject: Add setting to disable the anti-spam (#11296) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add environment variable to disable the anti-spam * Move antispam setting to admin settings * Fix typo * antispam → spam_check --- app/lib/spam_check.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'app/lib') 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? -- cgit