Remote follow: don't show confusing error if already following
authoreal <eal@waifu.club>
Thu, 9 Aug 2018 17:47:29 +0000 (20:47 +0300)
committereal <eal@waifu.club>
Thu, 9 Aug 2018 17:47:29 +0000 (20:47 +0300)
lib/pleroma/web/twitter_api/controllers/util_controller.ex

index 47fc79350e2b689be6effd22be906f23807f2d48..24ebdf007680f5f1dc65ea025e2d916ef000d15e 100644 (file)
@@ -99,6 +99,10 @@ defmodule Pleroma.Web.TwitterAPI.UtilController do
       conn
       |> render("followed.html", %{error: false})
     else
+      # Was already following user
+      {:error, "Could not follow user:" <> _rest} ->
+        render(conn, "followed.html", %{error: false})
+
       _e ->
         conn
         |> render("follow_login.html", %{
@@ -117,6 +121,11 @@ defmodule Pleroma.Web.TwitterAPI.UtilController do
       conn
       |> render("followed.html", %{error: false})
     else
+      # Was already following user
+      {:error, "Could not follow user:" <> _rest} ->
+        conn
+        |> render("followed.html", %{error: false})
+
       e ->
         Logger.debug("Remote follow failed with error #{inspect(e)}")