Commit 1b480e35 authored by kaniini's avatar kaniini

user: add helper for fetching profile url (which may be different than ap id)

parent a8137159
......@@ -42,6 +42,10 @@ def banner_url(user) do
end
end
def profile_url(%User{info: %{"source_data" => %{"url" => url}}}), do: url
def profile_url(%User{ap_id: ap_id}), do: ap_id
def profile_url(_), do: nil
def ap_id(%User{nickname: nickname}) do
"#{Web.base_url()}/users/#{nickname}"
end
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment