From 75e51b190d5b4bd4e9cbf6a669bfce7a440e1a5c Mon Sep 17 00:00:00 2001 From: Roger Braun Date: Wed, 22 Mar 2017 18:36:08 +0100 Subject: Add following TwAPI endpoint. --- lib/pleroma/web/twitter_api/twitter_api_controller.ex | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lib/pleroma/web/twitter_api/twitter_api_controller.ex') 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") -- cgit v1.2.3