about summary refs log tree commit diff
path: root/app/services/follow_service.rb
diff options
context:
space:
mode:
authormultiple creatures <dev@multiple-creature.party>2019-08-08 09:59:14 -0500
committermultiple creatures <dev@multiple-creature.party>2019-08-08 12:46:17 -0500
commit4dfc40324b1f3b20550982621501e162d2ed3bed (patch)
tree1578cba8809b7db27dc82f4d439471194d5fad31 /app/services/follow_service.rb
parentd019e55b7bc496d3c4d942fb4ffe65bb7e149249 (diff)
add new `reject unknown` policy option to prevent spam & harassment from large/undermoderated servers
Diffstat (limited to 'app/services/follow_service.rb')
-rw-r--r--app/services/follow_service.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/app/services/follow_service.rb b/app/services/follow_service.rb
index 3494dce99..776c4cb9b 100644
--- a/app/services/follow_service.rb
+++ b/app/services/follow_service.rb
@@ -14,6 +14,8 @@ class FollowService < BaseService
     raise ActiveRecord::RecordNotFound if target_account.nil? || target_account.id == source_account.id || target_account.suspended?
     raise Mastodon::NotPermittedError  if target_account.blocking?(source_account) || source_account.blocking?(target_account) || target_account.moved?
 
+    target_account.mark_known! unless target_account.known?
+
     if source_account.following?(target_account)
       # We're already following this account, but we'll call follow! again to
       # make sure the reblogs status is set correctly.