View Source Bonfire.Common.AntiSpam.Provider behaviour (Bonfire v0.9.10-classic-beta.169)
Provider Behaviour for anti-spam detection.
Supported backends
Credit to https://joinmobilizon.org for the original code.
Summary
Callbacks
Check a comment (or microblog) details
Check an user/account's details
Check an object details (such as a blog post)
Check profile info
Make sure the provider is ready
Types
@type result() :: spam_result() | {:error, any()}
@type spam_result() :: :ham | :spam | :discard
Callbacks
@callback check_comment( comment_body :: String.t(), is_reply? :: boolean(), context :: any() ) :: result()
Check a comment (or microblog) details
Check an user/account's details
Check an object details (such as a blog post)
Check profile info
@callback ready?() :: boolean()
Make sure the provider is ready
@callback report_ham(user :: any(), text :: String.t() | nil) :: :ok | {:error, atom()} | {:error, HTTPoison.Response.t()}
@callback report_spam(user :: any(), text :: String.t() | nil) :: :ok | {:error, atom()} | {:error, HTTPoison.Response.t()}