diff options
Diffstat (limited to 'lib/pleroma/web/twitter_api/twitter_api_controller.ex')
-rw-r--r-- | lib/pleroma/web/twitter_api/twitter_api_controller.ex | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/lib/pleroma/web/twitter_api/twitter_api_controller.ex b/lib/pleroma/web/twitter_api/twitter_api_controller.ex index f6574b8de..13de1661d 100644 --- a/lib/pleroma/web/twitter_api/twitter_api_controller.ex +++ b/lib/pleroma/web/twitter_api/twitter_api_controller.ex @@ -45,12 +45,12 @@ defmodule Pleroma.Web.TwitterAPI.Controller do def follow(%{assigns: %{user: user}} = conn, %{ "user_id" => followed_id }) do 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 @@ -86,6 +86,20 @@ defmodule Pleroma.Web.TwitterAPI.Controller do |> send_resp(200, response) end + def config(conn, _params) do + response = %{ + site: %{ + name: Pleroma.Web.base_url, + server: Pleroma.Web.base_url, + textlimit: -1 + } + } + |> Poison.encode! + + conn + |> json_reply(200, response) + end + defp json_reply(conn, status, json) do conn |> put_resp_content_type("application/json") |