Allow uploading a file for follow import.
authoreal <eal@waifu.club>
Tue, 12 Dec 2017 19:03:28 +0000 (21:03 +0200)
committereal <eal@waifu.club>
Tue, 12 Dec 2017 19:03:28 +0000 (21:03 +0200)
lib/pleroma/web/twitter_api/controllers/util_controller.ex

index c76486392d2b55e892ca1d369c2225176362dcf9..8eeaa0064827c3f02e9371737db7ef5fcf818c63 100644 (file)
@@ -74,6 +74,9 @@ defmodule Pleroma.Web.TwitterAPI.UtilController do
     json conn, Enum.into(Formatter.get_custom_emoji(), %{})
   end
 
+  def follow_import(conn, %{"list" => %Plug.Upload{} = listfile}) do
+    follow_import(conn, %{"list" => File.read!(listfile.path)})
+  end
   def follow_import(%{assigns: %{user: user}} = conn, %{"list" => list}) do
     errors = list
     |> String.split()