summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/web/router.ex1
-rw-r--r--lib/pleroma/web/twitter_api/twitter_api_controller.ex9
2 files changed, 10 insertions, 0 deletions
diff --git a/lib/pleroma/web/router.ex b/lib/pleroma/web/router.ex
index 7e4866c2f..7bb3c9763 100644
--- a/lib/pleroma/web/router.ex
+++ b/lib/pleroma/web/router.ex
@@ -43,5 +43,6 @@ defmodule Pleroma.Web.Router do
post "/favorites/create/:id", TwitterAPI.Controller, :favorite
post "/favorites/create", TwitterAPI.Controller, :favorite
post "/favorites/destroy/:id", TwitterAPI.Controller, :unfavorite
+ post "/statuses/retweet/:id", TwitterAPI.Controller, :retweet
end
end
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")