Merge branch 'develop' into 'develop'
Fix issue #124 Closes #124 See merge request pleroma/pleroma!108
This commit is contained in:
commit
3d636cf533
|
@ -212,9 +212,14 @@ def user_statuses(%{assigns: %{user: user}} = conn, params) 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"])
|
||||||
|
|
|
@ -316,6 +316,17 @@ test "gets a users statuses", %{conn: conn} 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"])
|
||||||
|
|
Loading…
Reference in New Issue