diff options
author | Alexander Strizhakov <alex.strizhakov@gmail.com> | 2021-01-26 16:55:44 +0300 |
---|---|---|
committer | Alexander Strizhakov <alex.strizhakov@gmail.com> | 2021-02-01 14:11:12 +0300 |
commit | 2cb6dc5a3a3bd7e2326fe632a34b74cb150c5821 (patch) | |
tree | 9b995c97849cbde429df3317b32e1d71ad56b455 /lib | |
parent | e21af1cfe48779427b6abf815022ebb88b6815d7 (diff) | |
download | pleroma-2cb6dc5a3a3bd7e2326fe632a34b74cb150c5821.tar.gz |
list timeline filtration by params
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pleroma/web/api_spec/operations/timeline_operation.ex | 7 | ||||
-rw-r--r-- | lib/pleroma/web/mastodon_api/controllers/timeline_controller.ex | 1 |
2 files changed, 6 insertions, 2 deletions
diff --git a/lib/pleroma/web/api_spec/operations/timeline_operation.ex b/lib/pleroma/web/api_spec/operations/timeline_operation.ex index 7b2fe48a5..e5bf18d4d 100644 --- a/lib/pleroma/web/api_spec/operations/timeline_operation.ex +++ b/lib/pleroma/web/api_spec/operations/timeline_operation.ex @@ -25,7 +25,7 @@ defmodule Pleroma.Web.ApiSpec.TimelineOperation do security: [%{"oAuth" => ["read:statuses"]}], parameters: [ local_param(), - remote_param(), + only_remote_param(), only_media_param(), with_muted_param(), exclude_visibilities_param(), @@ -134,6 +134,9 @@ defmodule Pleroma.Web.ApiSpec.TimelineOperation do required: true ), with_muted_param(), + local_param(), + only_remote_param(), + only_media_param(), exclude_visibilities_param() | pagination_params() ], operationId: "TimelineController.list", @@ -201,7 +204,7 @@ defmodule Pleroma.Web.ApiSpec.TimelineOperation do ) end - defp remote_param do + defp only_remote_param do Operation.parameter( :only_remote, :query, diff --git a/lib/pleroma/web/mastodon_api/controllers/timeline_controller.ex b/lib/pleroma/web/mastodon_api/controllers/timeline_controller.ex index b63945912..cef299aa4 100644 --- a/lib/pleroma/web/mastodon_api/controllers/timeline_controller.ex +++ b/lib/pleroma/web/mastodon_api/controllers/timeline_controller.ex @@ -192,6 +192,7 @@ defmodule Pleroma.Web.MastodonAPI.TimelineController do |> Map.put(:blocking_user, user) |> Map.put(:user, user) |> Map.put(:muting_user, user) + |> Map.put(:local_only, params[:local]) # we must filter the following list for the user to avoid leaking statuses the user # does not actually have permission to see (for more info, peruse security issue #270). |