Skip to content

Commit

Permalink
:sad:
Browse files Browse the repository at this point in the history
  • Loading branch information
rosylilly authored and kedamaDQ committed Feb 19, 2024
1 parent 593c13e commit c6a32f3
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions app/lib/activitypub/activity/create.rb
Original file line number Diff line number Diff line change
Expand Up @@ -426,4 +426,16 @@ def increment_voters_count!
poll.reload
retry
end

SPAM_FILTER_MINIMUM_FOLLOWERS = ENV.fetch('SPAM_FILTER_MINIMUM_FOLLOWERS', 0).to_i
SPAM_FILTER_MINIMUM_CREATE_DAYS = ENV.fetch('SPAM_FILTER_MINIMUM_CREATE_DAYS', 1).to_i
SPAM_FILTER_MINIMUM_MENTIONS = ENV.fetch('SPAM_FILTER_MINIMUM_MENTIONS', 1).to_i
def like_a_spam?
(
!@status.account.local? &&
@status.account.followers_count <= SPAM_FILTER_MINIMUM_FOLLOWERS &&
@status.account.created_at > SPAM_FILTER_MINIMUM_CREATE_DAYS.day.ago &&
@mentions.count > SPAM_FILTER_MINIMUM_MENTIONS
)
end
end

0 comments on commit c6a32f3

Please sign in to comment.