Welcome to mirror list, hosted at ThFree Co, Russian Federation.

spam_verdict_service.rb « spam « services « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 2b4d5f4a9846cffe29018c729c1d3e502a998eab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# frozen_string_literal: true

module Spam
  class SpamVerdictService
    include AkismetMethods
    include SpamConstants

    def initialize(target:, request:, options:)
      @target = target
      @request = request
      @options = options
    end

    def execute
      if akismet.spam?
        Gitlab::Recaptcha.enabled? ? REQUIRE_RECAPTCHA : DISALLOW
      else
        ALLOW
      end
    end

    private

    attr_reader :target, :request, :options
  end
end