discourse/plugins/discourse-ai/app/jobs/regular/ai_spam_scan.rb
Sam 7d89b9d46a
FIX: Wiki edits can silence the original author through AI spam scans (#39842)
under rare conditions spam scanning can be mis-attributed and apply to
author when an editor edited it.
2026-05-12 09:18:28 +10:00

16 lines
354 B
Ruby
Vendored

# frozen_string_literal: true
module Jobs
class AiSpamScan < ::Jobs::Base
def execute(args)
return if !args[:post_id]
post = Post.find_by(id: args[:post_id])
return if !post
DiscourseAi::AiModeration::SpamScanner.perform_scan(
post,
triggering_user_id: args[:triggering_user_id],
)
end
end
end