Merge branch 'develop' into 'develop'
Fix issue #124 Closes #124 See merge request pleroma/pleroma!108
This commit is contained in:
commit
3d636cf533
2 changed files with 19 additions and 3 deletions
|
@ -212,9 +212,14 @@ def user_statuses(%{assigns: %{user: user}} = conn, params) do
|
|||
|> Map.put("actor_id", ap_id)
|
||||
|> Map.put("whole_db", true)
|
||||
|
||||
activities =
|
||||
ActivityPub.fetch_public_activities(params)
|
||||
|> Enum.reverse()
|
||||
if params["pinned"] == "true" do
|
||||
# Since Pleroma has no "pinned" posts feature, we'll just set an empty list here
|
||||
activities = []
|
||||
else
|
||||
activities =
|
||||
ActivityPub.fetch_public_activities(params)
|
||||
|> Enum.reverse()
|
||||
end
|
||||
|
||||
conn
|
||||
|> add_link_headers(:user_statuses, activities, params["id"])
|
||||
|
|
|
@ -316,6 +316,17 @@ test "gets a users statuses", %{conn: conn} do
|
|||
assert id == to_string(note_two.id)
|
||||
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
|
||||
note = insert(:note_activity)
|
||||
user = User.get_by_ap_id(note.data["actor"])
|
||||
|
|
Loading…
Reference in a new issue