diff options
author | Roger Braun <roger@rogerbraun.net> | 2017-04-15 14:09:54 +0200 |
---|---|---|
committer | Roger Braun <roger@rogerbraun.net> | 2017-04-15 14:09:54 +0200 |
commit | 4799dc6991682489e8f1701946685a7725ad0a6a (patch) | |
tree | e1f7652fa3dd6ddd218158552b1045d6544b1d5b /lib/pleroma/web/twitter_api/twitter_api_controller.ex | |
parent | 60c60de330fe8fe03594da89831351099c8c9037 (diff) | |
download | pleroma-4799dc6991682489e8f1701946685a7725ad0a6a.tar.gz |
Add retweeting to TwAPI controller.
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 c71c123b2..a4d8a1d14 100644 --- a/lib/pleroma/web/twitter_api/twitter_api_controller.ex +++ b/lib/pleroma/web/twitter_api/twitter_api_controller.ex @@ -122,6 +122,15 @@ defmodule Pleroma.Web.TwitterAPI.Controller do |> json_reply(200, response) end + def retweet(%{assigns: %{user: user}} = conn, %{"id" => id}) do + activity = Repo.get(Activity, id) + {:ok, status} = TwitterAPI.retweet(user, activity) + response = Poison.encode!(status) + + conn + |> json_reply(200, response) + end + defp json_reply(conn, status, json) do conn |> put_resp_content_type("application/json") |