mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-27 21:47:59 +01:00
23 lines
745 B
Elixir
23 lines
745 B
Elixir
defprotocol Philomena.Attribution do
|
|
@doc """
|
|
Provides the "parent object" identifier for this object. This is so
|
|
that anonymous posts under the same topic id can return the same hash
|
|
for the same user.
|
|
"""
|
|
@spec object_identifier(struct()) :: String.t()
|
|
def object_identifier(object)
|
|
|
|
@doc """
|
|
Provides the "best" user identifier for an object. Usually this will be
|
|
the user_id, but may also be the fingerprint or IP address if other
|
|
information is unavailable.
|
|
"""
|
|
@spec best_user_identifier(struct()) :: String.t()
|
|
def best_user_identifier(object)
|
|
|
|
@doc """
|
|
Return whether this object is considered to be anonymous.
|
|
"""
|
|
@spec anonymous?(struct()) :: true | false
|
|
def anonymous?(object)
|
|
end
|