diff options
author | lambda <pleromagit@rogerbraun.net> | 2018-04-11 20:58:25 +0000 |
---|---|---|
committer | lambda <pleromagit@rogerbraun.net> | 2018-04-11 20:58:25 +0000 |
commit | 3d636cf533e7e73f35d1837bcc70e8d9f4306b37 (patch) | |
tree | e40113699d2ce459998dcbe27596c4a14b10d7f6 | |
parent | 5612716c25fa442f06a08083d945e421840300fe (diff) | |
parent | 2de2e29df2a0359fe87337111866b46efb848b7d (diff) | |
download | pleroma-3d636cf533e7e73f35d1837bcc70e8d9f4306b37.tar.gz pleroma-3d636cf533e7e73f35d1837bcc70e8d9f4306b37.zip |
Merge branch 'develop' into 'develop'
Fix issue #124
Closes #124
See merge request pleroma/pleroma!108
-rw-r--r-- | lib/pleroma/web/mastodon_api/mastodon_api_controller.ex | 11 | ||||
-rw-r--r-- | test/web/mastodon_api/mastodon_api_controller_test.exs | 11 |
2 files changed, 19 insertions, 3 deletions
diff --git a/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex b/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex index 21b99f919..21a3660c8 100644 --- a/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex +++ b/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex @@ -212,9 +212,14 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController 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"]) diff --git a/test/web/mastodon_api/mastodon_api_controller_test.exs b/test/web/mastodon_api/mastodon_api_controller_test.exs index 5d39c25c6..5293b9364 100644 --- a/test/web/mastodon_api/mastodon_api_controller_test.exs +++ b/test/web/mastodon_api/mastodon_api_controller_test.exs @@ -316,6 +316,17 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest 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"]) |