philomena/lib/philomena/posts/attribution.ex

13 lines
298 B
Elixir
Raw Normal View History

2019-11-11 17:56:34 +01:00
defimpl Philomena.Attribution, for: Philomena.Posts.Post do
def object_identifier(post) do
to_string(post.topic_id || post.id)
end
def best_user_identifier(post) do
to_string(post.user_id || post.fingerprint || post.ip)
end
def anonymous?(post) do
!!post.anonymous
end
2019-11-11 17:56:34 +01:00
end