From b462b46a809b512286473bc25f666d1a12556a88 Mon Sep 17 00:00:00 2001 From: multiple creatures Date: Sat, 16 Nov 2019 05:41:17 -0600 Subject: The WAS spammer detection is no longer needed; removing this code from the Janitor. --- app/workers/scheduler/janitor_scheduler.rb | 31 ------------------------------ 1 file changed, 31 deletions(-) (limited to 'app/workers/scheduler') diff --git a/app/workers/scheduler/janitor_scheduler.rb b/app/workers/scheduler/janitor_scheduler.rb index 7cba586a7..3d0e8e77c 100644 --- a/app/workers/scheduler/janitor_scheduler.rb +++ b/app/workers/scheduler/janitor_scheduler.rb @@ -20,7 +20,6 @@ class Scheduler::JanitorScheduler prune_deleted_accounts! suspend_abandoned_accounts! - suspend_spammers! silence_markov! import_blocklists! export_suspensions! @@ -40,13 +39,6 @@ class Scheduler::JanitorScheduler end end - def suspend_spammers! - reason = 'Appears to be a spammer account.' - spammer_accounts.find_each do |spammer| - account_policy(spammer.username, spammer.domain, :suspend, reason) - end - end - def silence_markov! reason = 'Appears to be a markov bot.' markov_accounts.find_each do |markov| @@ -96,12 +88,6 @@ class Scheduler::JanitorScheduler end - def spammer_accounts - spammer_ids = spammer_account_ids - Account.reorder(nil).where(id: spammer_ids, suspended_at: nil) - .where.not(id: @exclude_ids) - end - def markov_accounts Account.reorder(nil).where(silenced_at: nil).where.not(id: @exclude_markov) .where('username LIKE ? OR note ILIKE ?', '%ebooks%', '%markov%') @@ -134,10 +120,6 @@ class Scheduler::JanitorScheduler local_account_ids | outgoing_follow_ids | excluded_accounts_from_env('USERNAMES') end - def spammer_account_ids - post_spammer_ids | card_spammer_ids - end - def existing_policy_domains DomainBlock.all.pluck(:domain) end @@ -154,19 +136,6 @@ class Scheduler::JanitorScheduler Account.local.reorder(nil).flat_map { |account| account.following_ids } end - def post_spammer_ids - Status.with_public_visibility - .reorder(nil) - .where('tsv @@ to_tsquery(?)', 'womenarestupid.site & /blog/:*') - .pluck(:account_id) - end - - def card_spammer_ids - PreviewCard.where('url LIKE ? OR title ILIKE ?', '%womenarestupid%', '%womenaredumb%') - .reorder(nil) - .flat_map { |card| card.statuses.pluck(:account_id) } - end - def excluded_accounts_from_env(suffix) excluded_usernames = ENV.fetch("JANITOR_EXCLUDE_#{suffix.upcase}", '').split -- cgit