Follow import: allow URI in addition to screen_name.
authoreal <eal@waifu.club>
Sat, 7 Apr 2018 11:54:34 +0000 (14:54 +0300)
committereal <eal@waifu.club>
Sat, 7 Apr 2018 12:00:23 +0000 (15:00 +0300)
lib/pleroma/web/twitter_api/controllers/util_controller.ex

index 8f452c31c3f8b4df6065964e2bdeed2469842d5d..c7b1a5b95e34dbf6044fe509f9e927ea601b5d77 100644 (file)
@@ -182,13 +182,13 @@ defmodule Pleroma.Web.TwitterAPI.UtilController do
   def follow_import(%{assigns: %{user: user}} = conn, %{"list" => list}) do
     Task.start(fn ->
       String.split(list)
-      |> Enum.map(fn nick ->
+      |> Enum.map(fn account ->
         with %User{} = follower <- User.get_cached_by_ap_id(user.ap_id),
-             %User{} = followed <- User.get_or_fetch_by_nickname(nick),
+             %User{} = followed <- User.get_or_fetch(account),
              {:ok, follower} <- User.follow(follower, followed) do
           ActivityPub.follow(follower, followed)
         else
-          _e -> Logger.debug("follow_import: following #{nick} failed")
+          _e -> Logger.debug("follow_import: following #{account} failed")
         end
       end)
     end)