Unify user fetching.
This commit is contained in:
parent
e3a81fe58f
commit
c7be7a9454
|
@ -328,7 +328,8 @@ def conversation_id_to_context(id) do
|
||||||
end
|
end
|
||||||
|
|
||||||
def get_external_profile(for_user, uri) do
|
def get_external_profile(for_user, uri) do
|
||||||
with {:ok, %User{} = user} <- OStatus.find_or_make_user(uri) do
|
IO.inspect(uri)
|
||||||
|
with %User{} = user <- User.get_or_fetch_by_nickname(uri) do
|
||||||
spawn(fn ->
|
spawn(fn ->
|
||||||
with url <- user.info["topic"],
|
with url <- user.info["topic"],
|
||||||
{:ok, %{body: body}} <- @httpoison.get(url, [], follow_redirect: true, timeout: 10000, recv_timeout: 20000) do
|
{:ok, %{body: body}} <- @httpoison.get(url, [], follow_redirect: true, timeout: 10000, recv_timeout: 20000) do
|
||||||
|
|
Loading…
Reference in New Issue