Clean style.
authoreal <eal@waifu.club>
Sat, 28 Oct 2017 21:30:10 +0000 (00:30 +0300)
committereal <eal@waifu.club>
Sat, 28 Oct 2017 21:30:10 +0000 (00:30 +0300)
Use 'follow' instead of 'follows' and correct indentation.

lib/pleroma/web/mastodon_api/mastodon_api_controller.ex
lib/pleroma/web/router.ex

index 25c5418abe13f68ae25de12870761e8c2cc16166..971772810ea9f7e56728932b1dd8f37b8f3b3262 100644 (file)
@@ -282,10 +282,10 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController do
     end
   end
 
-  def follows(%{assigns: %{user: follower}} = conn, %{"uri" => uri}) do
+  def follow(%{assigns: %{user: follower}} = conn, %{"uri" => uri}) do
     with %User{} = followed <- Repo.get_by(User, nickname: uri),
-       {:ok, follower} <- User.follow(follower, followed),
-       {:ok, activity} <- ActivityPub.follow(follower, followed) do
+         {:ok, follower} <- User.follow(follower, followed),
+         {:ok, activity} <- ActivityPub.follow(follower, followed) do
       render conn, AccountView, "account.json", %{user: followed}
     else
       {:error, message} = err ->
index 557d094b4eba590dc79c18d48111a139218b9dc4..45c47eefb11eb8bd35e25a9878028cbd593839a0 100644 (file)
@@ -62,7 +62,7 @@ defmodule Pleroma.Web.Router do
     post "/accounts/:id/mute", MastodonAPIController, :relationship_noop
     post "/accounts/:id/unmute", MastodonAPIController, :relationship_noop
 
-    post "/follows", MastodonAPIController, :follows
+    post "/follows", MastodonAPIController, :follow
 
     get "/blocks", MastodonAPIController, :empty_array
     get "/domain_blocks", MastodonAPIController, :empty_array