mirror of
https://ghfast.top/https://github.com/discourse/discourse-akismet.git
synced 2026-07-15 11:36:24 +08:00
* REFACTOR: Move post spam detection logic into it's own bouncer class * REFACTOR: Created a Bouncer class to better organize the code
13 lines
384 B
Ruby
13 lines
384 B
Ruby
# frozen_string_literal: true
|
|
|
|
module Jobs
|
|
class CheckUsersForSpam < ::Jobs::Base
|
|
def execute(args)
|
|
user = User.includes(:user_profile).find_by(id: args[:user_id])
|
|
raise Discourse::InvalidParameters.new(:user_id) unless user.present?
|
|
|
|
client = Akismet::Client.build_client
|
|
DiscourseAkismet::UsersBouncer.new.perform_check(client, user)
|
|
end
|
|
end
|
|
end
|