aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorlambda <pleromagit@rogerbraun.net>2019-01-13 16:01:15 +0000
committerlambda <pleromagit@rogerbraun.net>2019-01-13 16:01:15 +0000
commitfbcb6f76b6023c203ff55023fb2e3fbd1b6c422a (patch)
tree99d43024b632d234596b1e233684624a5ad896d7 /lib
parent19b6a8239387869c69c6885044ee488d097b723f (diff)
parent98d9ae071877cb3e6cd65d84bfc142e9cbb998b0 (diff)
downloadpleroma-fbcb6f76b6023c203ff55023fb2e3fbd1b6c422a.tar.gz
Merge branch 'bugfix/favourites-link-header' into 'develop'
Add link headers and honour parameters on Mastodon API /favourites See merge request pleroma/pleroma!659
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/web/mastodon_api/mastodon_api_controller.ex5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex b/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex
index e00a3fb87..a8fe9d708 100644
--- a/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex
+++ b/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex
@@ -824,9 +824,9 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController do
json(conn, res)
end
- def favourites(%{assigns: %{user: user}} = conn, _) do
+ def favourites(%{assigns: %{user: user}} = conn, params) do
params =
- %{}
+ params
|> Map.put("type", "Create")
|> Map.put("favorited_by", user.ap_id)
|> Map.put("blocking_user", user)
@@ -836,6 +836,7 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController do
|> Enum.reverse()
conn
+ |> add_link_headers(:favourites, activities)
|> put_view(StatusView)
|> render("index.json", %{activities: activities, for: user, as: :activity})
end