Merge branch 'develop' into 'develop'

Fix issue #124

Closes #124

See merge request pleroma/pleroma!108
This commit is contained in:
lambda 2018-04-11 20:58:25 +00:00
commit 3d636cf533
2 changed files with 19 additions and 3 deletions

View File

@ -212,9 +212,14 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController do
|> Map.put("actor_id", ap_id) |> Map.put("actor_id", ap_id)
|> Map.put("whole_db", true) |> Map.put("whole_db", true)
activities = if params["pinned"] == "true" do
ActivityPub.fetch_public_activities(params) # Since Pleroma has no "pinned" posts feature, we'll just set an empty list here
|> Enum.reverse() activities = []
else
activities =
ActivityPub.fetch_public_activities(params)
|> Enum.reverse()
end
conn conn
|> add_link_headers(:user_statuses, activities, params["id"]) |> add_link_headers(:user_statuses, activities, params["id"])

View File

@ -316,6 +316,17 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do
assert id == to_string(note_two.id) assert id == to_string(note_two.id)
end end
test "unimplemented pinned statuses feature", %{conn: conn} do
note = insert(:note_activity)
user = User.get_by_ap_id(note.data["actor"])
conn =
conn
|> get("/api/v1/accounts/#{user.id}/statuses?pinned=true")
assert json_response(conn, 200) == []
end
test "gets an users media", %{conn: conn} do test "gets an users media", %{conn: conn} do
note = insert(:note_activity) note = insert(:note_activity)
user = User.get_by_ap_id(note.data["actor"]) user = User.get_by_ap_id(note.data["actor"])