View Source Mobilizon.Service.AntiSpam.Provider behaviour (Mobilizon v5.0.0-beta.1)

Provider Behaviour for anti-spam detection.

Supported backends

Summary

Types

@type result() :: spam_result() | {:error, any()}
@type spam_result() :: :ham | :spam | :discard

Callbacks

Link to this callback

check_comment(comment_body, username, is_reply?, email, ip, user_agent)

View Source
@callback check_comment(
  comment_body :: String.t(),
  username :: String.t(),
  is_reply? :: boolean(),
  email :: String.t() | nil,
  ip :: String.t(),
  user_agent :: String.t() | nil
) :: result()

Check a comment details

Link to this callback

check_event(event_body, username, email, ip, user_agent)

View Source
@callback check_event(
  event_body :: String.t(),
  username :: String.t(),
  email :: String.t() | nil,
  ip :: String.t(),
  user_agent :: String.t() | nil
) :: result()

Check an event details

Link to this callback

check_profile(username, summary, email, ip, user_agent)

View Source
@callback check_profile(
  username :: String.t(),
  summary :: String.t(),
  email :: String.t() | nil,
  ip :: String.t(),
  user_agent :: String.t() | nil
) :: result()

Check a profile details

Link to this callback

check_user(email, ip, user_agent)

View Source
@callback check_user(email :: String.t(), ip :: String.t(), user_agent :: String.t()) ::
  result()

Check an user details

@callback ready?() :: boolean()

Make sure the provider is ready