aboutsummaryrefslogtreecommitdiff
path: root/lib/pleroma/web/twitter_api/twitter_api_controller.ex
diff options
context:
space:
mode:
authorRoger Braun <roger@rogerbraun.net>2017-03-23 13:13:09 +0100
committerRoger Braun <roger@rogerbraun.net>2017-03-23 13:13:09 +0100
commit30650e5bc610810d129bf02891a73ac11340710b (patch)
tree961bc760faea353f875f32325acd0cc296ce16ad /lib/pleroma/web/twitter_api/twitter_api_controller.ex
parent75e51b190d5b4bd4e9cbf6a669bfce7a440e1a5c (diff)
downloadpleroma-30650e5bc610810d129bf02891a73ac11340710b.tar.gz
Add unfollowing to TwAPI.
Diffstat (limited to 'lib/pleroma/web/twitter_api/twitter_api_controller.ex')
-rw-r--r--lib/pleroma/web/twitter_api/twitter_api_controller.ex10
1 files changed, 10 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 ac319b109..d574f1003 100644
--- a/lib/pleroma/web/twitter_api/twitter_api_controller.ex
+++ b/lib/pleroma/web/twitter_api/twitter_api_controller.ex
@@ -41,6 +41,16 @@ defmodule Pleroma.Web.TwitterAPI.Controller do
|> json_reply(200, response)
end
+ def unfollow(%{assigns: %{user: user}} = conn, %{ "user_id" => followed_id }) do
+ { :ok, _user, follower } = TwitterAPI.unfollow(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")