about summary refs log tree commit diff
diff options
context:
space:
mode:
authormultiple creatures <dev@multiple-creature.party>2020-01-30 02:35:15 -0600
committermultiple creatures <dev@multiple-creature.party>2020-01-30 02:35:15 -0600
commit389125d894b01a4049e22b6e49a1e84b524440a6 (patch)
tree7f81f064af76da960ddd86a995ed519c2696f63c
parentba0febd3c1b1bb05c3036ad43c0a15e7e562a000 (diff)
use upstream spam detection
-rw-r--r--app/models/user.rb24
1 files changed, 0 insertions, 24 deletions
diff --git a/app/models/user.rb b/app/models/user.rb
index 733a34ef4..45eb33a1c 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -489,11 +489,6 @@ class User < ApplicationRecord
     super
   end
 
-  def send_confirmation_instructions
-    return false if detect_spam!
-    super
-  end
-
   def send_reset_password_instructions
     return false if encrypted_password.blank? && (Devise.pam_authentication || Devise.ldap_authentication)
     super
@@ -557,25 +552,6 @@ class User < ApplicationRecord
     end
   end
 
-  def detect_spam!
-    return false if valid_invitation? || external? || Setting.registrations_mode == 'none'
-
-    janitor = janitor_account || Account.representative
-
-    intro = self.invite_request&.text
-    # normalize it
-    intro = intro.gsub(/[\u200b-\u200d\ufeff\u200e\u200f]/, '').strip.downcase unless intro.nil?
-
-    return false unless intro.blank? || intro.split.count < 5 || SPAM_TRIGGERS.match?(intro)
-
-    user_friendly_action_log(janitor, :reject_registration, self.account.username, "Registration was spam filtered.")
-    Form::AccountBatch.new(current_account: janitor, account_ids: account_id, action: 'reject').save
-
-    true
-  rescue ActiveRecord::RecordNotFound, ActiveRecord::RecordInvalid
-    false
-  end
-
   def janitor_account
     account_id = ENV.fetch('JANITOR_USER', '').to_i
     return if account_id == 0