diff options
author | Roger Braun <roger@rogerbraun.net> | 2017-03-22 18:36:08 +0100 |
---|---|---|
committer | Roger Braun <roger@rogerbraun.net> | 2017-03-23 12:09:27 +0100 |
commit | 75e51b190d5b4bd4e9cbf6a669bfce7a440e1a5c (patch) | |
tree | 4a0d15872d1fcd8ae64dacd9508e0c3a09aea502 /lib/pleroma/web/twitter_api/twitter_api_controller.ex | |
parent | e2e0cd75b77778cb7adf911cf279d0ccc008dab1 (diff) | |
download | pleroma-75e51b190d5b4bd4e9cbf6a669bfce7a440e1a5c.tar.gz |
Add following TwAPI endpoint.
Diffstat (limited to 'lib/pleroma/web/twitter_api/twitter_api_controller.ex')
-rw-r--r-- | lib/pleroma/web/twitter_api/twitter_api_controller.ex | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/pleroma/web/twitter_api/twitter_api_controller.ex b/lib/pleroma/web/twitter_api/twitter_api_controller.ex index 088439f48..ac319b109 100644 --- a/lib/pleroma/web/twitter_api/twitter_api_controller.ex +++ b/lib/pleroma/web/twitter_api/twitter_api_controller.ex @@ -32,6 +32,15 @@ defmodule Pleroma.Web.TwitterAPI.Controller do |> json_reply(200, json) end + def follow(%{assigns: %{user: user}} = conn, %{ "user_id" => followed_id }) do + { :ok, _user, follower } = TwitterAPI.follow(user, followed_id) + + response = follower |> UserRepresenter.to_json + + conn + |> json_reply(200, response) + end + defp json_reply(conn, status, json) do conn |> put_resp_content_type("application/json") |