Unify user fetching.
[akkoma] / lib / pleroma / web / twitter_api / twitter_api.ex
index ccd79625cdb4dc9d96d6ef48a7ee8a1a4c59340a..61b11681a08589744c4d278d9e49bf82e13b55e5 100644 (file)
@@ -43,8 +43,8 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPI do
 
   def fetch_user_statuses(user, opts \\ %{}) do
     opts = opts
-    |> Map.put("type", ["Create", "Announce", "Follow"])
-    ActivityPub.fetch_activities([], opts)
+    |> Map.put("type", ["Create"])
+    ActivityPub.fetch_public_activities(opts)
     |> activities_to_statuses(%{for: user})
   end
 
@@ -328,7 +328,8 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPI do
   end
 
   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 ->
         with url <- user.info["topic"],
              {:ok, %{body: body}} <- @httpoison.get(url, [], follow_redirect: true, timeout: 10000, recv_timeout: 20000) do