diff options
author | Haelwenn (lanodan) Monnier <contact@hacktivis.me> | 2020-03-29 22:30:50 +0200 |
---|---|---|
committer | Haelwenn (lanodan) Monnier <contact@hacktivis.me> | 2020-03-31 23:54:20 +0200 |
commit | b30fb1f3bbf8fb8e49cc5276225dc09771c79477 (patch) | |
tree | 341f41a4b0d4fee44ddcb93a0403d1c8b413e94e /lib | |
parent | 2553400a662de7170dd56ee0950a6c1bb1513e45 (diff) | |
download | pleroma-b30fb1f3bbf8fb8e49cc5276225dc09771c79477.tar.gz |
User: Fix use of source_data in profile_url/1
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pleroma/user.ex | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/pleroma/user.ex b/lib/pleroma/user.ex index d9aa54057..ca0bfca11 100644 --- a/lib/pleroma/user.ex +++ b/lib/pleroma/user.ex @@ -305,7 +305,8 @@ defmodule Pleroma.User do end end - def profile_url(%User{source_data: %{"url" => url}}), do: url + def profile_url(%User{uri: url}) when url != nil, do: url + def profile_url(%User{source_data: %{"url" => url}}) when is_binary(url), do: url def profile_url(%User{ap_id: ap_id}), do: ap_id def profile_url(_), do: nil @@ -314,7 +315,7 @@ defmodule Pleroma.User do def ap_followers(%User{follower_address: fa}) when is_binary(fa), do: fa def ap_followers(%User{} = user), do: "#{ap_id(user)}/followers" - @spec ap_following(User.t()) :: Sring.t() + @spec ap_following(User.t()) :: String.t() def ap_following(%User{following_address: fa}) when is_binary(fa), do: fa def ap_following(%User{} = user), do: "#{ap_id(user)}/following" |