From: dtluna Date: Thu, 13 Apr 2017 12:36:00 +0000 (+0300) Subject: Merge branch 'develop' of ssh.gitgud.io:lambadalambda/pleroma into bugfix/repeated... X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=a8e50d602ba25b2062e0e676e1dd115da64c2565;p=akkoma Merge branch 'develop' of ssh.gitgud.io:lambadalambda/pleroma into bugfix/repeated-follow-unfollow --- a8e50d602ba25b2062e0e676e1dd115da64c2565 diff --cc lib/pleroma/web/twitter_api/twitter_api_controller.ex index f6574b8de,3f299a941..13de1661d --- a/lib/pleroma/web/twitter_api/twitter_api_controller.ex +++ b/lib/pleroma/web/twitter_api/twitter_api_controller.ex @@@ -44,13 -44,12 +44,13 @@@ defmodule Pleroma.Web.TwitterAPI.Contro end def follow(%{assigns: %{user: user}} = conn, %{ "user_id" => followed_id }) do - { :ok, user, follower, _activity } = TwitterAPI.follow(user, followed_id) - - response = follower |> UserRepresenter.to_json(%{for: user}) - - conn - |> json_reply(200, response) + case TwitterAPI.follow(user, followed_id) do - { :ok, _user, followed, _activity } -> ++ { :ok, user, followed, _activity } -> + response = followed |> UserRepresenter.to_json(%{for: user}) - conn |> json_reply(200, response) ++ conn ++ |> json_reply(200, response) + { :error, msg } -> forbidden_json_reply(conn, msg) + end - end def unfollow(%{assigns: %{user: user}} = conn, %{ "user_id" => followed_id }) do