From a46ab86adfc9e4ea182af9a555237f17071e194c Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Thu, 4 Oct 2018 17:36:11 +0200 Subject: Limit the number of people that can be followed from one account (#8807) Configurable soft limit of 7,500, and above that, configurable ratio of 1.1 * followers, controlled by: - MAX_FOLLOWS_THRESHOLD - MAX_FOLLOWS_RATIO Fix #2311 --- app/models/follow_request.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'app/models/follow_request.rb') diff --git a/app/models/follow_request.rb b/app/models/follow_request.rb index 9c4875564..c5451a050 100644 --- a/app/models/follow_request.rb +++ b/app/models/follow_request.rb @@ -22,6 +22,7 @@ class FollowRequest < ApplicationRecord has_one :notification, as: :activity, dependent: :destroy validates :account_id, uniqueness: { scope: :target_account_id } + validates_with FollowLimitValidator, on: :create def authorize! account.follow!(target_account, reblogs: show_reblogs, uri: uri) -- cgit